Command prompt could be used to do some amazing things with just a few characters while without command prompt it would take lot of time to do same thing via GUI.
Command prompt is not much popular among users because:
- They are having another, much simpler way to do it via GUI, but it takes time.
- They don't know exactly, How to use it.
At first glance you might take command prompt as a boring and useless tool, but advanced users could tell you, it makes their life easier.
Starting Command Prompt (CMD)
- Press Win+R then type CMD or cmd and hit ENTER. OR
- Search CMD and open.
Let's try out some cool tricks.
Changing Font and Background Colors
- Just right click on top of command prompt window.
- Click Properties.
- Open Colors tab and there you go.
Graphical structure of drive or path.
TREE C:and hit ENTER.
If you want files to be listed too then type
TREE C: /F.
Above command shows Graphical Strucuture of C: drive but if you want to have Graphical structure of a specific path or such as there's a folder cygwin in C: drive and we want it's structure then type
Checking IP address and all.
Getting help via CMD
Command/?here we just append /? at the very end of your command.
Running more than one Command simultaneously.
- If you hide files/ folders via this method it, you can't unhide them via GUI.
- Files or Folders hidden via this method are not even shown when you chose show Hidden files and folders option in Folder view.
Okay Let's try this out.
- Type "attrib +s +h File-Location" and hit ENTER. Eg. If I want to hide a folder named pics in E: drive , then the command goes as "attrib +s +h E:\pics".
- To unhide just type "attrib -s -h File-Location".
Aborting a command in its tracks.
Use Function keys to increase your speed and help you come out of writing same commands again and again.
|F9||Asks for the number of the command from the F7 list to paste|
|F8:||Pastes recently executed commands (cycles)|
|F7:||Displays a selectable list of previously executed commands|
|F6:||Pastes ^Z to the prompt|
|F5:||Pastes recently executed commands (does not cycle)|
|F4:||Deletes current prompt text up to the entered character|
|F3:||Pastes the last executed command|
|F2:||Pastes the last executed command (up to the entered character)|
|F1:||Pastes the last executed command (character by character)|
Opening command Prompt from any location.
- Navigate to the folder where you want to open Command Prompt.
- Hold down Shift key and Right click on the folder's name.
- In the popup you will notice something that's usually not there "Open Command Promt Windows here".
If you're an advanced user, you'll instantly recognize value of this trick.
Tired of typing long paths in Command Prompt.
Just Navigate to the file/folder whose path you want to use in your command. Once there, Drag and drop the File/Folder to command prompt window.
Mind it... It saves a lot of time.
Shutdown or Restart another Computer
shutdown/icommand, easiest of all. It opens remote shutdown dialog box. Enter the name of PC, select your choices and click OK.
Make Your Keyboard type a message continuoulsy [VBS Trick]
Set wshShell = wscript.CreateObject("WScript.Shell")
wshshell.sendkeys "This is a Virus. You have been infected."
For fun you could send this file as an email attachment.
Create a Virus that ejects CD/DVD/BD drives continuously [VBS Trick]
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
For i = 0 to colCDROMs.Count - 1
Double click to open this file and see the magic.
Display a Funny Message containing Reason for Shutdown.
shutdown -s -t 500 -c "Skynet has become Self Aware. John Conor Can't Stop me. YOu can't use your PC anymore."
Find hidden Files and Folders.
These are Some command prompt Tricks. Let me know via Comments if you like them or if you want any help.