anrotr ‘Useful Commans Prompt (CMD) Tricks You Shou Know
18 Useful Command Prompt Tricks You Might Not
Know
Last Updated: September 27, 2016
When you have such an attractive interface, using Command Prompt might seem like a old
fashioned thing. When you can easily navigate to a location or access different settings in
your PC customize them, why go for complex commands and a dull interface? Well, it
might not be as bad as one might think. Command Prompt might be a bit complex, but it
makes all the manual tweaking just a single command's work. The current users of
Command Prompt understand how powerful it is, which is why they don’t mind learning
few tricks or commands to take care of daily work in a snap. So learning at least basics of
Command Prompt is worth saving few seconds of extra work everyday.
We have created this list of Command Prompt commands and tricks that may help you
work better. Whether you just started using Command Prompt or you are a regular user,
you should be able to find a trick to ease things up a bit.
Update: If you want the latest Command Prompt tricks, you can also check out our fresh
post on cool Command Prompt tricks (Part 2).
Some Useful Command Prompt Tricks
1. Get help on almost every Command
Fhpboebom comicommand-pramp-rcks! wnsanrotr ‘18 Useful Conmans Prompt (CMO) Tricks You Shou Know
BE Administrator: CAWindows\:ystem?2\emdexe
eae Cee eer eee
Caer)
Snare are Coet cena cee a2
Se eee ee gee eee eee egress
PSSM NSC m SIT Citar acess ts
peoaes!
Fresiretazees
Eres ir erate
Feist
ipconfig ‘release xCont
Prenat gett entencarntes
Petr eC ce ae
PENCLISTEE
eet
dor renewed.
eee eso
Neer
Rieti etre
Rrra t met rare
PC acres Com een Cs
Recreate
bs rerrer stu fics trainees
Pema Tem ee Mc trts Chae mars
Berreree met iettare
Reece!
Poerroniey
rset eet ecco Lay y
pe aereacony os
This is especially helpful for beginners, but advanced users may get to learn few things too.
You can easily get info on almost every command you provide in the Command Prompt.
Information includes complete details of what a command dot
used, it may also show some examples.
ind what process are
‘To get the help, just type “/?” at the end of the command of which you need info. For
example, you can type “ipeonfig/?”, and you will get all the info.
Fhpboebom comicommand-pramp-rcks!
21sanrotr ‘Useful Commans Prompt (CMD) Tricks You Shou Know
2. Use Function Keys
You can use function keys (F1, F2, F3, etc.) right inside command prompt and get different
results, Below are the uses of functions keys in Command Prompt:
+ Fi: Pastes per character last used command
+ F2: Pastes last used command only to a specified command character
+ Fg: Pastes Last used command
+ F4: Delete command only to a specified command character
+ F5: Pastes last used command without cycling
+ F6: Pastes *Z
* F7: Provides a list of already used commands (selectable)
+ F:8 Pastes cycleable used commands
+ Fo; Will let you paste command from the list of recently used commands
3. Save a Command to a File
If you want to save results of a command to a .txt for future referen
, then it is quite easy
as well. All you need to do is add “> (destination/file name with .txt extension)” at
the end of the command you are about to execute.
epebebom comicammand-prampt tricks! ansanvaosr ‘18Usetl Commarea Prompt (CMD) Treks You Shoulé Know
For example, you can type “ipconfig > c:\Networkdetails.txt”, this command will
create a .txt file in C drive with name “Networkdetails”.
4. Copy Data from the Command Prompt
Cee Score
Mark
cS
reas
Baste
cS CeCe SelectAll
PST coe
Tete scroll
PS re mca}
PSE ee Eind,
Petpet rs
baeureroes
ora ened
rosa e hd
Loa ae hd
pays
aes
ier ested
New folder <2>
eDrive
Pictures
ever ones
BYTE Peeters
Copying data from the Command Prompt isn’t just a Ctrl+C away, the process is actually
different. It is not that hard, just right click anywhere in the window and click on “Mark”
from the menu. After that, just select the text you want to copy and hit Enter to copy it.
Important Note: With Windows 10, Ctrl+C and Ctrl+V commands to copy/paste has
been enabled in Command Prompt. So you don't need to follow the above process, if you
are using Windows 10. Also, In Windows 10 keyboard shortcuts for CMD are enabled by
default which wasn’t the case with earlier version of Windows.
5. Cycle Through Folders
Specifying exact directories can be a bit frustrating task if you don’t have the destination
copied. However, if you just know in which drive or folder the required folder is located,
Fhpboebom comicommand-pramp-rcks! ansanvaosr ‘18Usetl Commarea Prompt (CMD) Treks You Shoulé Know
then you can cycle through all the folders to reach it. To do this, just type specified drive
and start press TAB key on your keyboard to cycle through all the folders inside it.
6. Use QuickEdit Mode
Command Prompt comes with QuickEdit Mode to quickly copy and paste content
with just your right-click. In QuickEdit mode, you can highlight content and right-click
to copy it or right-click in a blank area to paste content from the clipboard (if there is
any).
To enable QuickEdit Mode, right-click on the top of the Command Prompt interface
(where exit button is located) and select “Properties”. In the properties, check the
checkbox next to “QuickEdit Mode” to enable it (you will have to disable it later).
7. Check IP address of any Website
Fhpboebom comicommand-pramp-rcks! 55anrotr ‘Useful Commans Prompt (CMO) Tricks You Shou Know
EM ern eecsesSo stam SO
ese cy
Sees
Cae rs reery
coer aCe ELT
CREE eeettess
You can see IP address of any website just by
the name of the websit.
IP address.
y entering “nslookup” command along with
For example, you can type “nslookup beebom.com” to find its
8. Execute Multiple Commands
epebebom comicammand-prampt tricks!
aisanrotr ‘8 Useful Commans Prompt (CMO) Tricks You Shou Know
FE Administrator: C\Windowe\:ystem?2\emdexe
NUsers\Adninistrator> ipconfig && dir
eee
Fey
Caste a reteCaAg ce
H iar eres erste e ota LLe |
ca eras = 192.168.1.100
iat ts : aera
Defaule Gatewa Errietr seen
eo
Po remets
Se eter
Cee eae eee ccd
ieiirestipercss H
ir tae hae ena Se eer aS cS i
PSreeere Meee Te Ery
Peete oN een erecta
3/31/2015 Fett :
mete :
et Pry
series MRO TESS Ccrtetes
You can easily execute one command after another by provide all the commands and
putting “&&” between each command (may save some time). For example, you can type
“ipconfig && dir” to execute both commands one after anoth:
9. Check Default Programs
Fhpboebom comicommand-pramp-rcks!
m8anrotr ‘Useful Commans Prompt (CMD) Tricks You Shou Know
creme eee
ray
eruniiStsery
mien rina tea mre rE e rg
Mier res Meow erin sed
Pema
BRU Neco ere CU een re Lea
Tse Irenny acento
tagreckrsii st
RIiteurem tery
Etrichentines er etcenenes
You can check which applications are used to open specific types of programs. For this
purpose, just type “assoc” in the Command Prompt and hit enter. You will see all the
extensions and their associated program that opens them written next to them.
10. Get PC Drivers List
Fhpboebom comicommand-pramp-rcks!
ansanrotr ‘8 Useful Commans Prompt (CMD) Tricks You Shou Know
BBE Administration C\Windows\:ystem32\emdexe
esc cere rere
eee at ee UL
1394 ONC! Compliant Ho Kernel
Leesa a most PaUara
ACPI Powex Meter Drive Kernel Rear
peng cores eer
cre Prey ores Eau rast
miter preter) paar PET a
Piste rma iss Beery
Pesto Tee Set gegttt
ea ee
paren ry Ate
Ce eae eres’ raeetiy
Pareeny Beer
CeCe ted Beatty
geet
reas Oty TT
aera Brg
ete Petey
rere eter
Appid Driver ers PBterr yy
ate ate Peres
prterey era eter
Stores Kgteri
ey ates ever
eet ee ere ese PAeer TT
Ete e rasa eres 472472013 =
bteles ieee ted tet tery
You can open list of all the drivers installed on your PC with just a single command, Just
type “driverquery’ in the Command Prompt and press Enter. After a short delay, you
will see all the drivers installed in your PC along with, Name, Type and Link date.
11. Scan System Files
Fhpboebom comicommand-pramp-rcks! ansanrotr ‘Useful Conmans Prompt (CMO) Tricks You Shou Know
rT
Ce) 2009 Microsoft Corporation. All rights reserved.
Sera) eee eso
CTU SECC ee
GBS Log windir\Logs\GBS\CES og. For exanple
SUE NG Rye ae td $ s 5 "
‘The system files can also be scanned and repaired from the Command Prompt. Type
“sfe/scannow’ and press enter, the scan will start and may take quite some time
depending on your PC speed (up to an hour may be). It will either automatically repair the
files or let you know if there is a problem and provide its details.
12. Change Command Prompt Color
epebebom comicammand-prampt tricks! 10sanrotr ‘Useful Commans Prompt (CMD) Tricks You Shou Know
You can als
dull and a bit ea
eyes. To do so, right-click at the top corners of Command Prompt and sclect “Properties”
from the menu, In the properties, navigate to “Colors” tab and you will find all the
options to change color of both text and background
change command prompt color to make it look |
13. Create Undelete-able Folders
esc cere rere
You can create undeletable folders using specific set of keywords. In the Command
Prompt, type the name of the drive where you want to create the folder (it must not have
Windows installed in it). After that, type any of these keywords “md con\” or “md
Ipt1\” and press Enter. So it should look something like this “D: md con\”.
This will create a folder with th:
me name that could not be deleted or renamed. To
delete the folder replace “md con\” with “rd con\” or “md Ipti\’ with “rd Ipt1\”.
14. Get Network Details
epebebom comicammand-prampt tricks! 15anrotr ‘8 Useful Conmans Prompt (CMO) Tricks You Shou Know
id Aarariarvon CAWadovAjerszcrdom Eas
esc cere rere
COE Cesc TentsCny
OCC Coe CCR CCC Ce
noes ce sec ts aan
et ete cere’ Mee rec terete rey
rar een eure tyaeti webct)
Et ry SE Sea a
berks a ana. Ses
thernet adapter Local Area Connection 2:
Cees ee reared
PTs tire CLS
ee ee CS ea Lr
Cee ee reeeeeeeccce|
Connect ion-spe
.
You can get quick network details, like IP address and subnet mask or Default Gateway
with a single command. Type “ipconfig” and press Enter, you will see all the details of
your network.
15. Hide Files and Folders using Command Prompt
epebebom comicammand-prampt tricks!
wnsanrotr ‘8 Useful Commans Prompt (CMO) Tricks You Shou Know
re
ate rS tec
You can hide folder with the help of Command Prompt that cannot be accessed using the
traditional hide feature of Windows. To do this, type the drive name where the folder is
located and then enter this command “Attrib +h +s +r” and afterwards, enter the name
of the file/folder you want to hide. So it should look something like this “D: Attrib +h +s
+r haider’.
If the folder is inside another folder, then the command must come before the folder/file
the folder, use the same
"from “Attrib +h +s +r”.
you want to hide not just after the Drive name. To again s
process above but change the command to “Attrib -h -s
16. Compare Two Files
epebebom comicammand-prampt tricks! 195anvzos7 18Useiul Commara Prompt (CM) Treks You Should Know
BE C\Windowa\cystern32\emd exe oa &
Me 2087 Microsoft Corporation. ALL rights
NON
Sear eses
Tees CCU SMe aeons
Uc
eee ot ecg
OUTCAST ECLy
neountered
You can also compare two text files in command prompt and see the difference. The
results won't be as good as third-party available file comparison tools, but it is worth a
shot and fun do!
All you need to do is type “FC” command and then enter directories of both text files (the
files must be in .txt format for proper working). For example, you can type “fe
C:\haider\samplet.txt C:\haider\samplez.txt” and hit enter to get comparison of
both files with answer such as, files are different or both files are identical.
In the above example, “C:” is the drive where text file is located, “haider’” is the name of the
folder in which the text file in located and “Sample1.txt” is name of the text file. Both files
can be located anywhere in your PC, you just need to provide the right directory.
If both the files have different content then running this command will show the different
content and if both the files have exact same content, the command will return this
message ‘no difference encountered’.
17. Watch Star Wars Episode IV
Fhpboebom comicommand-pramp-rcks! wisanrotr ‘8 Useful Conmans Prompt (CMD) Tricks You Shou Know
IB Telnet towel blinkenlights eS sa
Coe ee Cy
eee eae ee Tee Ty
Eee ee eee ec}
ete tien
Ce Ce LTT)
ee eC ee
a cae)
Prete te)
fy
Crh
This is a really cool trick, although not productive, but fun to do. You can actually watch
the famous Star Wars Episode IV right inside your Command prompt. It will be an
ASCII version so don’t hope for a HD movie.
The process is simple, open Command Prompt and enter this command “telnet
towel.blinkenlights.nl” and hit Enter. The movie will start automatically without any
delay.
Note: Make sure Telnet is enabled in your PC, you can get information to install
and enable Telnet from Microsoft website.
18. Create Wi-Fi Hotspot using Command Prompt
Fhpboebom comicommand-pramp-rcks! ss18