#1 By: howtogeek, July 30th, 2013 06:40
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.
#2 By: Erik Hicks, July 30th, 2013 09:41
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.
#3 By: Keltari, July 30th, 2013 10:16
Shutdown /i - granted that brings up the GUI, but I use it all the time.
#4 By: z7b, July 30th, 2013 10:44
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.
#5 By: Naman Sood, July 30th, 2013 10:47
taskkill /f /im process.exe
Ends the process "process.exe".
#6 By: Owen Standage, July 30th, 2013 10:49
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
#7 By: Grant Johnson, July 30th, 2013 12:31
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.
#8 By: ycheneye, July 30th, 2013 16:14
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.
#9 By: TechCheckers, July 30th, 2013 18:52
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
#10 By: Jason Brown, July 30th, 2013 21:22
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.
#11 By: Lowell Heddings, July 30th, 2013 21:51
Telnet is not encrypted, so in general it is to be avoided. For some things though, it is just fine.
#12 By: Jason Brown, July 31st, 2013 01:56
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.
#13 By: Tyler Slocum, August 2nd, 2013 12:05
#14 By: A happy, August 2nd, 2013 16:13
ASCIII STAR WARS
#15 By: Naman Sood, August 3rd, 2013 02:45
Only to I's in ASCII. Other than that,
#16 By: A happy, August 4th, 2013 09:07
Damn my quick typing skills... gotta learn to touch-type
#17 By: Tyler Slocum, August 5th, 2013 09:16
You ever look at a correctly spelled word, and it just looks weird? Two... two... two??!
#18 By: Naman Sood, August 5th, 2013 09:38
Many, many times. For example, gorgeous somehow reminds me of gorgons...
#20 By: Don Gateley, August 7th, 2013 02:56
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.
#21 By: Johny Woller Skovdal, August 7th, 2013 03:52
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 →