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.
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.
Shutdown /i - granted that brings up the GUI, but I use it all the time.
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.
taskkill /f /im process.exe
Ends the process "process.exe".
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
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.
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.
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 188.8.131.52 -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
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.
Telnet is not encrypted, so in general it is to be avoided. For some things though, it is just fine.
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.
ASCIII STAR WARS
Only to I's in ASCII. Other than that,
Damn my quick typing skills... gotta learn to touch-type
You ever look at a correctly spelled word, and it just looks weird? Two... two... two??!
Many, many times. For example, gorgeous somehow reminds me of gorgons...
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.
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 →