You are on page 1of 13

4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

PC & MOBILE LIFESTYLE HARDWARE

WINDOWS Tina Sieber


835 articles
15 Windows Command Prompt Tina has been writing about consumer

(CMD) Commands You Must technology for over a decade. She holds a
Doctorate in Natural Sciences, a Diplom fro

Know Germany, and an MSc from Sweden. Her


analytical background has helped her excel
By Tina Sieber / Updated January 26, 2019 26-01-2019 a technology journalist at MakeUseOf, whe
she's now managing keyword research and
Microsoft has slowly pushed aside CMD commands in the Windows operations.
interface. This is not without reason; it is an antiquated and mostly
unnecessary tool from an era of text-based input. But many
commands remain useful, and Windows 8 and 10 even added new
features.
Trending Now
Advertisement
The Best Free Movie Streaming
Sites
by Ben Stegner

How to Watch Netflix With


Friends Far Away: 7 Methods
That Work
by Dan Price

How to Watch Instagram Live


Videos on Your PC or Mac
by Shianne Edelmayer

How to Use Your iPhone as a


Here we present the essential commands every Windows user Webcam: A Step-by-Step Guide
by Dan Price
needs to know.
Top 4 Unbiased World News
Sources Free From Censorship
by Gavin Phillips

Unlock our "100+ Essential Windows The 10 Best Apps to Make Free
Group Conference Calls
CMD Commands" cheat sheet now! by Ben Stegner

This will sign you up to our newsletter The 15 Best Two-Player Mobile
Games to Play Anywhere
your@email.com Unlock by Megan Ellis

Yes, Get Microso Word for


Read our privacy Free: Here’s How
policy by Mihir Patkar

In case you’re not sure how to access the Windows command


prompt, forgot basic Windows commands, or would like to know Latest Giveaways! ✖
how to see a list of switches for each command (aka prompt codes),
Retroflag GPi is the Ultimate
you can refer to our beginners guide to the Windows command Portable Retro Gaming Consol
line for instructions. by Christian Cawley

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 1/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

Maxoak Bluetti 1500Wh Backu


A Beginner's
PC & MOBILE Guide To The Windows
LIFESTYLE HARDWARE Solar Generator Review: Be
Command Line Ready for Anything
by James Bruce
The command line lets you communicate directly with
Divoom Pixoo Backpack: Light
your computer and instruct it to perform various tasks.
Up The World (with Pixel Art)
Read More by James Bruce

Creative Super X-Fi AIR Review


Spatial Audio Done Right
by Tina Sieber
Prefer this tutorial in video form? We’ve got you covered:

Latest Videos

YouTube Channels Trivia (S1 E1)

Windows Command Prompt Commands

1. Assoc

Is Your iPhone Too Hot? Here's


Why, and How to Fix It!

Most les in Windows are associated with a speci c program that What Is Trivial Geeks? Show
is assigned to open the le by default. At times, remembering these Format and Rules
associations can become confusing. You can remind yourself by
entering the command “assoc” to display a full list of le name
extensions and program associations.

You can also extend the command to change le associations. For ✖


example, “assoc .txt=” will change the le association for text les
to whatever program you enter after the equal sign. The “Assoc”
command itself will reveal both the extension names and program

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 2/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

names, which will help you properly use this command. You can RetroFlag GPi Case: Ultimate
PC & MOBILE LIFESTYLE HARDWARE
probably do this more easily in the GUI, but the command line Retro Gaming Portable Console!
interface is a perfectly functional alternative.

2. Cipher

Maxoak Bluetti EB150: Power


Through the Apocalypse!

Deleting les on a mechanical hard drive doesn’t really delete them


at all. Instead, it marks the les as no longer accessible and the
space they took up as free. The les remain recoverable until the How to Access Apple iCloud from
system overwrites them with new data, which can take some time. Android

The cipher command, however, wipes a directory by writing random


data to it. To wipe your C drive, for example, you’d use the command
“cipher /w:c”, which will wipe free space on the drive. The command
does not overwrite undeleted data, so you will not wipe out les you
need by running this command.

You can use a host of other cipher commands, however, they are
generally redundant with BitLocker enabled versions of Windows.

3. Driverquery

ExpressVPN™- Fast Premium


VPN
No Data Retention. Access Content from
Anywhere. 24/7 Live Suppo .

Open

Latest Deals

Drivers remain among the most important software installed on a
PC. Improperly con gured or missing drivers can cause all sorts of
trouble, so its good to have access to a list of what’s on your PC.

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 3/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

That’s exactly what the “driverquery” command does. You can Learn How to $
PC & MOBILE LIFESTYLE HARDWARE
extend it to “driverquery -v” to obtain more information, including Draw Freebie $
the directory in which the driver is installed. Bundle

Take Back Control Over Driver Updates in The Project $199


Manager's $49.
Windows 10
Essential
A bad Windows driver can ruin your day. In Windows 10,
Windows Update automatically updates hardware drivers.
If you suffer the consequences, let us show you how to
roll back your driver and block future...
Babbel Language $39
Learning: $15
Read More
Lifetime

4. File Compare The Lifetime MBA $162


Bootcamp $2
Bundle

You can use this command to identify differences in text between


two les. It’s particularly useful for writers and programmers trying
to nd small changes between two versions of a le. Simply type
“fc” and then the directory path and le name of the two les you
want to compare.

You can also extend the command in several ways. Typing “/b”
compares only binary output, “/c” disregards the case of text in the
comparison, and “/l” only compares ASCII text.

So, for example, you could use the following:

fc /l "C:\Program Files (x86)\example1.doc" "C:\Program

The above command compares ASCII text in two word documents.



5. Ipconfig

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 4/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

PC & MOBILE LIFESTYLE HARDWARE

This command relays the IP address that your computer is


currently using. However, if you’re behind a router (like most
computers today), you’ll instead receive the local network address
of the router.

Still, ipcon g is useful because of its extensions. “ipcon g /release”


followed by “ipcon g /renew” can force your Windows PC into
asking for a new IP address, which is useful if your computer claims
one isn’t available. You can also use “ipcon g / ushdns” to refresh
your DNS address. These commands are great if the Windows
network troubleshooter chokes, which does happen on occasion.

6. Netstat

Entering the command “netstat -an” will provide you with a list of
currently open ports and related IP addresses. This command will
also tell you what state the port is in – listening, established or
closed.

This is a great command for when you’re trying to troubleshoot


devices connected to your PC or when you fear a Trojan infected
your system and you’re trying to locate a malicious connection.

7. Ping

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 5/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

PC & MOBILE LIFESTYLE HARDWARE

Sometimes, you need to know whether or not packets are making it


to a speci c networked device. That’s where ping comes in handy.

Typing “ping” followed by an IP address or web domain will send a


series of test packets to the speci ed address. If they arrive and are
returned, you know the device is capable of communicating with
your PC; if it fails, you know that there’s something blocking
communication between the device and your computer. This can
help you decide if the root of the issue is an improper con guration
or a failure of network hardware.

8. PathPing

This is a more advanced version of ping that’s useful if there are


multiple routers between your PC and the device you’re testing.
Like ping, you use this command by typing “pathping” followed by
the IP address, but unlike ping, pathping also relays some
information about the route the test packets take.

9. Tracert

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 6/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

PC & MOBILE LIFESTYLE HARDWARE

The “tracert” command is similar to pathping. Once again, type


“tracert” followed by the IP address or domain you’d like to trace.
You’ll receive information about each step in the route between
your PC and the target. Unlike pathping, however, tracert also
tracks how much time (in milliseconds) each hop between servers
or devices takes.

10. Powercfg

Powercfg command on Windows 10.

Powercfg is a very powerful command for managing and tracking


how your computer uses energy. You can use the command
“powercfg hibernate on” and “powercfg hibernate off” to manage
hibernation, and you can also use the command “powercfg /a” to
view the power-saving states currently available on your PC.

Another useful command is “powercfg /devicequery


s1_supported”, which displays a list of devices on your computer
that support connected standby. When enabled, you can use these
devices to bring your computer out of standby — even remotely.
You can enable this by selecting the device in Device Manager,
opening its properties, going to the Power Management tab and
then checking the Allow this device to wake the computer box.

“Powercfg /lastwake” will show you what device last woke your PC
from a sleep state. You can use this command to troubleshoot your
PC if it seems to wake from sleep at random.

Powercfg energy command in Administrator command prompt


on Windows 10.

You can use the “powercfg /energy” command to build a detailed


power consumption report for your PC. The report saves to the

directory indicated after the command nishes. This report will let
you know of any system faults that might increase power
consumption, like devices blocking certain sleep modes, or poorly
con gured to respond to your power management settings.
https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 7/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

Windows 8 added “powercfg /batteryreport”, which provides a


PC & MOBILE LIFESTYLE HARDWARE
detailed analysis of battery use, if applicable. Normally output to
your Windows user directory, the report provides details about the
time and length of charge and discharge cycles, lifetime average
battery life, and estimated battery capacity.

11. Shutdown

Shutdown command on Windows 10.

Windows 8 introduced the shutdown command that—you guessed


it!—shuts down your computer.

How to Shutdown or Sleep Windows 10


With a Keyboard Shortcut
Looking for a Windows 10 sleep shortcut? Here's how to
shut down or put your computer to sleep with just the
keyboard.

Read More

This is, of course, redundant with the already easily accessed


shutdown button, but what’s not redundant is the “shutdown /r /o”
command, which restarts your PC and launches the Advanced Start
Options menu, which is where you can access Safe Mode and
Windows recovery utilities. This is useful if you want to restart your
computer for troubleshooting purposes.

12. Systeminfo

Systeminfo command as seen on Windows 10.

This command will give you a detailed con guration overview of


your computer. The list covers your operating system and
hardware. For example, you can look up the original Windows
installation date, the last boot time, your BIOS version, total and
available memory, installed hot xes, network card con gurations,
and more.

Use “systeminfo /s” followed by the host name of a computer on


your local network, to remotely grab the information for that
system. This may require additional syntax elements for the
domain, user name, and password, like this: “systeminfo /s

[host_name] /u [domain]\[user_name] /p [user_password]”

13. System File Checker

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 8/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

System File Checker sfc command options available on Windows


PC & MOBILE LIFESTYLE HARDWARE
10.

System File Checker is an automatic scan and repair tool that


focuses on Windows system les.

How to Fix a Corrupted Windows 10


Installation
System corruption is the worst that could happen to your
Windows installation. We show you how to get Windows
10 back on track when suffering from BSODs, driver
errors, or other unexplained issues.

Read More

You will need to run the command prompt with administrator


privileges and enter the command “sfc /scannow”. If SFC nds any
corrupt or missing les, it will automatically replace them using
cached copies kept by Windows for this purpose alone. The
command can require a half-hour to run on older notebooks.

14. Tasklist

Tasklist command as shown in Windows command prompt


window.

You can use the “tasklist” command to provide a current list of all
tasks running on your PC. Though somewhat redundant with Task
Manager, the command may sometimes nd tasks hidden from
view in that utility.

There’s also a wide range of modi ers. “Tasklist -svc” shows


services related to each task, use “tasklist -v” to obtain more detail
on each task, and “tasklist -m” will locate .dll les associated with
active tasks. These commands are useful for advanced
troubleshooting.

15. Taskkill

Taskkill command options available on Windows 10.

Tasks that appear in the “tasklist” command will have an executable


and process ID (a four- or ve-digit number) associated with them.
You can force stop a program using “taskkill -im” followed by the ✖
executable’s name, or “taskkill -pid” followed by the process ID.
Again, this is a bit redundant with Task Manager, but you can use it
to kill otherwise unresponsive or hidden programs.

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 9/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

Windows 8 Only: Recovery


PC & MOBILE ImageHARDWARE
LIFESTYLE

Virtually all Windows 8/8.1 computers ship from the factory with a
recovery image, but the image may include bloatware you’d rather
not have re-installed. Once you’ve un-installed the software you can
create a new image using the “recimg” command. Entering this
command presents a very detailed explanation of how to use it.

You must have administrator privileges to use the “recimg”


command, and you can only access the custom recovery image you
create via the Windows 8 “refresh” feature.

In Windows 10, system recovery has changed. Windows 10


systems don’t come with a recovery partition, which makes it more
important than ever to back up your data.

4 Ways to Factory Reset Your Windows 10


Computer
Want to know how to factory reset a PC? We show you
the best methods to reset a Windows computer using
Windows 10, 8, or 7.

Read More

CMD Commands Recommended by


Readers
These are the commands our readers use regularly:

nbstat: “For looking up names of computers on your network.”


(Vferg)

netstat -ano | nd “est”: “To get a list of processes with


established CP connections.” (Eric)

tasklist | nd “[process id]”: “To get the name of the


executable associated with the particular process id that I’m
interested in.” (Eric)

cacls: This command is “most handy to manually access


hidden les and folder. (A41202813)

net use: “To map drives of networked CNC machines.” (Jimbo)



chkdsk /f C: “Checks your C: partition hard disk for errors and
xes bad sectors.” (Kai M)

Schtasks: To schedule tasks. (Teddy)

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 10/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

Command and
PC Conquer
& MOBILE Your Windows
LIFESTYLE HARDWARE

PC
This article can only give you a taste of what’s hidden within the
Windows command line. When including all variables, there are
literally hundreds of commands. Download Microsoft’s command
line reference guide (in Edge or Internet Explorer) for advanced
support and troubleshooting.

If you also use Linux, have a look at some useful ways to use the df
command.

Explore more about: Command Prompt, Computer Maintenance.

Af liate Disclosure: By buying the products we recommend, you help keep the site
alive. Read more.

Email Facebook Pinterest Twitter

Enjoyed this article? Stay informed by


joining our newsletter!

your@email.com Submit

Read our privacy


policy

108 COMMENTS WRITE A COMMENT

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 11/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

How to Easily Remove Bloatware From Windows 10


PC & MOBILE LIFESTYLE HARDWARE

100% Disk Usage in Windows 10 Fixed With 14 Tricks

Windows 10 Won’t Boot? 12 Fixes to Get Your PC Running Again

Connected to Wi-Fi, But No Internet Access in Windows? Here’s the Fix!

6 Ways to Fix Slow Boot Times in Windows 10

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 12/13
4/20/2020 15 Windows Command Prompt (CMD) Commands You Must Know

PC & MOBILE LIFESTYLE HARDWARE

How to Fix the System Service Exception Stop Code in Windows 10

Windows 10 Taskbar Not Working? 6 Fast Fixes

5 Ways to Fix a Stuck Pixel on Your Screen

© 2020 MakeUseOf. All Rights Reserved.

https://www.makeuseof.com/tag/15-cmd-commands-every-windows-user-know/ 13/13

You might also like