howtogeek at July 30th, 2013 06:40 — #1
Originally published at: http://www.howtogeek.com/168896/10-useful-windows-commands-you-should-know/
There are some things you can only do from the command line, even on Windows. Some of these tools don’t have graphical equivalents, while others are just plain faster to use than their graphical interfaces.
erikhicks at July 30th, 2013 09:41 — #2
Don't forget about "GPUPDATE /FORCE". So many network/permissions issues have been resolved using this one!
Also - "hostname" is good in Windows 7 to let you know the computer name.
"Timeout" is another very useful tool for batch file scripts to add timed pauses. Too many people still use a "ping" command redirected to NUL to do this - lame.
acf at July 30th, 2013 10:16 — #3
Shutdown /i - granted that brings up the GUI, but I use it all the time.
z7b at July 30th, 2013 10:44 — #4
I always like to recommend 'netstat -ano' which shows process numbers as well. Makes it easier to pull up task manager (or more preferably Process Explorer) and find out what exact process is using or listening for connections.
nsdcars5 at July 30th, 2013 10:47 — #5
taskkill /f /im process.exe
Ends the process "process.exe".
owen123 at July 30th, 2013 10:49 — #6
Not sure but where it gives the command for
cipher – Permanently Delete and Overwrite a Directory
It says to use
I dont know but is it meant to be cipher not ciper based on
amadensor at July 30th, 2013 12:31 — #7
An additional use for Telnet is to see if a server is reachable and listening on a particular port. Even if you do not have an SMTP client, you can "telnet mailserver.com 25" and see if you get a response. This is very useful in troubleshooting connection issues.
ycheneye at July 30th, 2013 16:14 — #8
If you've made any modifications to Windows bootup screens and lock screen (e.g. adding XBMC logos for a HTPC) those will be removed by sfc /scannow.
techcheckers at July 30th, 2013 18:52 — #9
Three really useful additions are the Forward Slash + K Switch :: /k :: allowing command(s) to be RUN directly from the RUN box , the Double Ampersand :: && :: for joining commands together and the Greater Than Sign :: > :: for outputting data to a file:
Example of /k switch
cmd /k ipconfig /all
Will display the ipconfig info, from the RUN box, without having to launch to CLI initially.
Secondly is the &&, allow concatenating (joining) of commands.
Example of &&
cmd /k cd \ && md foo && cd foo && md apps backups drivers && md backups && md "Ccleaner Backups"
Launch cmd.exe and change directory to root of C:\ ; make a directory at root of c named foo; change directory to foo and make directories apps, backups and drivers, change directory to backups and create a Directory call Ccleaner Backups.
Outputting CMD results to text File
Example of using > symbol to ouput results to a text file.
cmd /k cd "program files" > C:\My_progs_list.txt
Creates a list of instaled programs in a text file named My_progs_list in C:\ Drive
cmd /k ping 22.214.171.124 -t > C:\PINGTEST.txt
outputs a continuous ping test to the text file.
( No results appear in the CLI/CMD box while this is running).
[ To STOP or CANCEL the command : control + C].
And result can be viewed through opening the saved text file at C:\PINGTEST
Good L.U.C.K = L abouring U nder C orrect K nowledge
jmbpiano at July 30th, 2013 21:22 — #10
You should avoid using telnet if you can help it...
Could you possibly elaborate on this? I could understand avoiding the Telnet Server as a security hole, but the client? Is there some risk I'm unaware of? I've never heard of anyone being compromised by logging into a MUD, for example.
geek at July 30th, 2013 21:51 — #11
Telnet is not encrypted, so in general it is to be avoided. For some things though, it is just fine.
jmbpiano at July 31st, 2013 01:56 — #12
So is HTTP and email. Would you also make the statement that they should be avoided in general? Don't mean to sound antagonistic- just rather confused as to why you would feel the need to explicitly warn against using telnet if the only problem is it doesn't have as many features as other protocols. I would expect most everyone here knows you use HTTPS to do your banking, PGP(or similar) to send encrypted communications and SSH for secure remote access.
Oh well, not really complaining- you just had me worried I'd been exposing myself to some danger I'd not heard about before.
robotsneedhugs2 at August 2nd, 2013 12:05 — #13
nanogeek at August 2nd, 2013 16:13 — #14
ASCIII STAR WARS
nsdcars5 at August 3rd, 2013 02:45 — #15
Only to I's in ASCII. Other than that,
nanogeek at August 4th, 2013 09:07 — #16
Damn my quick typing skills... gotta learn to touch-type
robotsneedhugs2 at August 5th, 2013 09:16 — #17
You ever look at a correctly spelled word, and it just looks weird? Two... two... two??!
nsdcars5 at August 5th, 2013 09:38 — #18
Many, many times. For example, gorgeous somehow reminds me of gorgons...
dongateley at August 7th, 2013 02:56 — #20
Does the && cause the command interpreter to wait for what is prior to it to finish before going on? Sequential lines in a .bat file don't. If a command requires the previous one to complete in order to work correctly it usually won't. Classic example is:
rmdir /s /q LastBackup
rename CurrBackup LastBackup
The rename can fail because the preceding rmdir is still in progress or if that one squeaks by, the mkdir can fail because the rename is still in progress. Really stupid way to do things but then it is Microsoft. I think gates wrote cmd.exe before he mercifully quit coding.
johny at August 7th, 2013 03:52 — #21
It does wait on a result yes, and if the previous execution failed, it won't continue.
Using a single "&" will make it continue even when experiencing errors, and after a quick test, yes "&" does indeed also wait for the previous statement to finish.
(you can perform the test yourself by e.g. executing this: "echo 1 & echo 2 & Timeout 10 /NOBREAK & echo 3")
next page →