howtogeek — 2013-07-30T06:40:23-04:00 — #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 — 2013-07-30T09:41:09-04:00 — #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 — 2013-07-30T10:16:28-04:00 — #3
Shutdown /i - granted that brings up the GUI, but I use it all the time.
z7b — 2013-07-30T10:44:23-04:00 — #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 — 2013-07-30T10:47:03-04:00 — #5
taskkill /f /im process.exe
Ends the process "process.exe".
owen123 — 2013-07-30T10:49:31-04:00 — #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 — 2013-07-30T12:31:52-04:00 — #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 — 2013-07-30T16:14:34-04:00 — #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 — 2013-07-30T18:52:40-04:00 — #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 220.127.116.11 -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 — 2013-07-30T21:22:01-04:00 — #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 — 2013-07-30T21:51:41-04:00 — #11
Telnet is not encrypted, so in general it is to be avoided. For some things though, it is just fine.
jmbpiano — 2013-07-31T01:56:54-04:00 — #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 — 2013-08-02T12:05:37-04:00 — #13
nanogeek — 2013-08-02T16:13:21-04:00 — #14
ASCIII STAR WARS
nsdcars5 — 2013-08-03T02:45:39-04:00 — #15
Only to I's in ASCII. Other than that,
nanogeek — 2013-08-04T09:07:54-04:00 — #16
Damn my quick typing skills... gotta learn to touch-type
robotsneedhugs2 — 2013-08-05T09:16:42-04:00 — #17
You ever look at a correctly spelled word, and it just looks weird? Two... two... two??!
nsdcars5 — 2013-08-05T09:38:39-04:00 — #18
Many, many times. For example, gorgeous somehow reminds me of gorgons...
dongateley — 2013-08-07T02:56:22-04:00 — #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 — 2013-08-07T03:52:02-04:00 — #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 →