80+ Windows Command Prompt Commands: A Practical Cheatsheet with Examples

Most people avoid the Command Prompt because it looks overwhelming. A black screen, a blinking cursor, and no buttons. But once you understand it, CMD becomes one of the fastest problem-solving tools on Windows. 

When my files refuse to delete, my system slows down, the internet lags, or Windows behaves strangely, I mostly use Windows Command Prompt commands. 

The real issue is how poorly it is explained traditionally. So, I have prepared a cheat sheet of the most useful and some critical CMD commands and a beginner-friendly guide to cut the noise and help you navigate easily.

Quick List of Useful Windows Command Prompt Commands

If you want the essentials and don’t want to scroll through long tables and explanations, this is your cheat sheet. These commands cover most everyday Windows tasks and common problems.

  1. Basic Commands:
    • help – List all CMD commands 
    • cls – Clear the screen
    • dir – Show files and folders
    • cd – Change directory
    • ver – Check Windows version
    • exit – Close Command Prompt
  2. File & Folder:
    • copy – Copy files
    • move – Move or rename files
    • del – Delete files permanently
    • mkdir – Create folders
    • rmdir – Delete folders
    • robocopy – Advanced file copy
  3. Disk & Storage:
    • chkdsk – Check and fix disk errors
    • diskpart – Manage disks and partitions
    • format – Format a drive
  4. Network:
    • ipconfig – View IP and network info
    • ping – Test connectivity
    • tracert – Trace network route
    • netsh – Reset network settings
  5. Processes & System:
    • tasklist – View running processes
    • taskkill – Force-close apps
    • systeminfo – System details
  6. Windows Repair:
    • sfc /scannow – Repair system files
    • DISM /Online /Cleanup-Image /RestoreHealth – Fix Windows image

What are Windows CMD Commands?

What is Command Prompt?

Command Prompt is a built-in Windows tool that lets you communicate with the operating system using text commands instead of clicks. It is like having a direct conversation with Windows.

Instead of opening menus and pressing buttons, you type a command, and Windows responds with real system-level feedback. It may look old-school, but when the graphic interface fails, CMD usually keeps working.

Windows Command Prompt commands are text-based instructions that tell Windows exactly what to do. Each command performs a specific job. Some commands only show information, while others can change settings, repair files, reset networks, or control running processes.

Windows CMD commands

Windows has hundreds of CMD commands, and there are some version-specific commands as well. So, it is always smart to confirm compatibility before running advanced commands.

What makes CMD powerful is precision. You can give clear instructions, and Windows executes them exactly as written. That is why CMD feels raw, fast, and honest.

Basic Windows Command Prompt Commands

These commands help you navigate CMD, control how it looks, and understand what environment you are working in.

CommandDescriptionSyntaxExampleOutput/Output Meaning
CLSClears the command prompt screenclsclsScreen clears
CMDOpens a new CMD windowcmdcmdNew command prompt appears
HELPShows all available CMD commandshelphelpLists supported commands
EXITCloses the CMD windowexitexitCMD session ends
COLORChanges the text and background color of CMDcolor [attr]color 0AText color changes
TITLESets the CMD window titletitle [text]title Admin ConsoleWindow title updates
PROMPTCustomizes the prompt textprompt [text]prompt $p$gPath shown before prompt
VERShows the current Windows versionververOS version displayed
CHCPShows or changes the code pagechcp [nnn]chcpDisplays active code page
DOSKEYEnables command history and creates macrosdoskeydoskeyCommand recall enabled
MODEConfigures system devicesmodemodeDevice status shown
MOREShows output page by pagedir | moredir | morePauses output per screen
SORTSorts command outputdir | sortdir | sortSorted results displayed
PAUSEPauses batch executionpausepauseWaits for key press
ECHODisplays text or toggles command echoingecho [text]echo DonePrints message
REMAdds comments in batch filesrem [comment]rem testNo output

File and Folder Management Commands

The following commands allow you to create, delete, move, compare, inspect, and manage files and directories.

CommandDescriptionSyntaxExampleOutput/Output Meaning
DIRLists directory contentsdirdirFiles and folders shown
CD / CHDIRChanges directorycd [path]cd C:\UsersNo output if successful
TREEShows folder structuretree [path]tree C:\Data /FFolder hierarchy displayed
MD / MKDIRCreates a directorymkdir [name]mkdir LogsFolder created silently
RD / RMDIRDeletes a directoryrmdir /s [dir]rmdir /s OldFolder removed
COPYCopies filescopy [source] [dest]copy a.txt D:\Files copied
XCOPYCopies files and directoriesxcopy [source] [dest] /Excopy C:\A D:\B /ETree copied
ROBOCOPYAdvanced copy toolrobocopy [source] [dest]robocopy C:\A D:\B /MIRCopy summary
MOVEMoves files/foldersmove [source] [dest]move a.txt D:\File relocated
DEL / ERASEDeletes filesdel [file]del old.txtFile deleted
REN / RENAMERenames filesren old newren a.txt b.txtName changed
REPLACEReplaces filesreplace [source] [dest]replace a.txt D:\File replaced
TYPEDisplays file contentstype [file]type readme.txtText shown
PRINTPrints text fileprint [file]print note.txtSent to printer
EDITOpens text editoredit [file]edit config.txtEditor opens
FINDFinds text in a filefind “text” filefind “err” log.txtMatches shown
FINDSTRAdvanced text searchfindstr text filesfindstr err *.logMatches listed
FCCompares text filesfc f1 f2fc a.txt b.txtDifferences shown
COMPCompares binary filescomp f1 f2comp a.bin b.binBinary diff
EXPANDExtracts compressed filesexpand [source] [dest]expand file.cab C:\TempFiles expanded
OPENFILESShows open filesopenfilesopenfiles /queryOpen files listed
ATTRIBChanges file attributesattrib +/-attr fileattrib -h a.txtAttributes changed
ASSOCFile extension mappingassoc .extassoc .txtFile type shown
FTYPEFile type behaviorftype [type]ftype txtfileExecutable mapping
MKLINKCreates symbolic linksmklink link targetmklink a bLink created

Disk and Storage Management Commands

These Command Prompt commands can help you manage disks, partitions, file systems, and storage health.

CommandDescriptionSyntaxExampleOutput/Output Meaning
CHKDSKChecks disk errorschkdsk drive /fchkdsk C: /fDisk report
CHKNTFSDisk check at bootchkntfs /dchkntfs /dDefaults restored
DISKPARTDisk partition tool. It can also help in partition recoverydiskpartdiskpartDisk shell opens
FORMATFormats diskformat driveformat D:Disk formatted
LABELSets volume labellabel drive namelabel E: BackupLabel updated
VOLShows volume infovol drivevol C:Label + serial
DEFRAGDefragments diskdefrag drivedefrag C:Fragmentation report
COMPACTNTFS compressioncompact filecompact /c a.txtCompression result
CONVERTFAT to NTFSconvert drive /fs:ntfsconvert D: /fs:ntfsConversion progress
FSUTILFile system controlfsutil cmdfsutil fsinfo drivesDrive list
RECOVERRecovers datarecover filerecover D:\a.txtData recovered

Network and Internet Troubleshooting CMD Commands

Network and internet commands are essential for diagnosing connectivity issues, DNS errors, and routing failures.

CommandDescriptionSyntaxExampleOutput/Output Meaning
IPCONFIGNetwork configurationipconfig /allipconfig /allIP details
PINGTests connectivityping hostping google.comLatency & loss
TRACERTTraces routetracert hosttracert 8.8.8.8Network hops
PATHPINGAdvanced tracingpathping hostpathping google.comLoss per hop
NSLOOKUPDNS lookupnslookup hostnslookup openai.comDNS response
NETSTATActive connectionsnetstat -anonetstat -anoPorts & PIDs
ROUTERouting tableroute printroute printRoutes shown
ARPIP-MAC mappingarp -aarp -aARP table
NETSHNetwork settingsnetsh cmdnetsh winsock resetStack reset
GETMACMAC addressesgetmacgetmacMAC listed
HOSTNAMEComputer namehostnamehostnameName shown
NBTSTATNetBIOS statsnbtstat -nnbtstat -nNetBIOS info
TFTPFile transfertftp hosttftp -i host put a.txtTransfer status
TELNETRemote terminaltelnet hosttelnet mail.com 25Remote session
NET USENetwork drivesnet use drive sharenet use Z: \\Srv\ShareDrive mapped

Process, Service, and Performance Windows CMD Commands

Use the following commands to monitor running applications, services, and system performance. 

CommandDescriptionSyntaxExampleOutput/Output Meaning
TASKLISTLists processestasklisttasklistRunning tasks
TASKKILLKills processestaskkill /pid idtaskkill /pid 1234 /fProcess ended
SYSTEMINFOSystem detailssysteminfosysteminfoHardware info
DRIVERQUERYLists driversdriverquerydriverqueryDriver list
SCService controlsc querysc queryService status
SCHTASKSScheduled tasksschtasks /queryschtasks /queryTask list
STARTStarts programsstart appstart notepadApp opens
WMICSystem querieswmic cmdwmic cpu get nameCPU info
SETEnv variablesset varset PATHValue shown
SETXPersistent varssetx var valsetx TEST 1Saved
WHOAMICurrent userwhoamiwhoamiUser shown

Windows System Repair Commands (Must Know)

These commands are critical for fixing corrupted Windows components and boot issues. 

CommandDescriptionSyntaxExampleOutput/Output Meaning
SFCRepairs system filessfc /scannowsfc /scannowRepair status
DISMRepairs imageDISM /Online /Cleanup-Image /RestoreHealthsameImage repaired
BCDEDITBoot configbcdeditbcdeditBoot entries
REAGENTCRecovery envreagentc /inforeagentc /infoRecovery status
VERIFYDisk verificationverify onverify onWrite check
WBADMINBackup toolwbadmin get versionswbadmin get versionsBackup list
VSSADMINShadow copiesvssadmin list shadowssameShadow list

Advanced CMD Commands for Power Users and Troubleshooting

These are some advanced Windows Command Prompt commands that are mainly used in scripting, automation, security, and enterprise environments.

CommandDescriptionSyntaxExampleOutput/Output Meaning
CALLCalls the batch filecall file.batcall test.batReturns after
FORLoops commandsfor %f in () dofor %f in (*.txt) do type %fIterated output
IFConditional logicif conditionif exist a.txt echo okCondition result
GOTOJumps labelsgoto labelgoto endFlow jump
SHIFTShifts argumentsshiftshiftParams shifted
SETLOCALLocal envsetlocalsetlocalScope starts
ENDLOCALEnd local envendlocalendlocalScope ends
PUSHDSaves directorypushd pathpushd D:\Directory saved
POPDRestores directorypopdpopdDirectory restored
PATHSets exe pathset path valueset PATH=%PATH%;C:\ToolsPath set
RUNASRun as userrunas /user:u cmdrunas /user:Admin cmdNew session
TAKEOWNOwnershiptakeown /f filetakeown /f a.txtOwner changed
ICACLSPermissionsicacls fileicacls a.txt /grant U:FACL updated
CACLSLegacy ACLscacls filecacls a.txtACL shown
CIPHEREncrypts filescipher /E pathcipher /E C:\SecEncrypted
NET USERUser accountsnet user u pnet user test 123 /addUser added
GPRESULTPolicy resultgpresult /rgpresult /rPolicy report
GPUPDATERefresh policygpupdate /forcegpupdate /forcePolicy updated

Why Use Command Prompt Instead of Windows UI?

Command Prompt exists for moments when clicking around either fails, slows you down, or simply does not give you real answers. Here is why you should rely more on the Command Prompt:

  • It displays exact errors, not vague messages. Instead of messages like ‘Something went wrong’, CMD tells you what failed, where it failed, and why it failed. That clarity can save you hours during troubleshooting.
  • When File Explorer crashes or settings refuse to open, you can still launch the Command Prompt on most occasions. It needs fewer system resources and does not depend on graphical components.
  • CMD is faster for repeated tasks like deleting files, resetting networks, checking disk health, or killing frozen apps. It just takes a few seconds. Doing the same through menus takes much longer. 
  • It gives you full control and allows you to target exact files, folders, services, and system components.
  • It grows with your skill level. You can start with simple commands like ‘dir’ and ‘ipconfig’. Over time, you will be able to repair Windows images, fix corrupted SD cards, automate tasks, and diagnose deep system issues.

Windows Command Prompt is not meant to replace UI. But it is a better option when accuracy, speed, and recovery matter to you.

Important Things to Know Before Using CMD

Command Prompt is powerful, which can also hurt you if not used properly. Before you run commands blindly, keep the following things in mind:

  • Many commands require admin rights. So, if you are working with system files, disks, or network settings, always open CMD as an administrator.
  • CMD does not ask for confirmation; commands like deleting a folder or formatting drives happen immediately. A wrong path can cause instant damage. So, always proofread your command before pressing Enter.
  • Make sure you always read the output information. Ignoring output means missing half the message.
  • CMD is literal in nature; paths, spelling, quotes, and spaces matter. A single mistake can break a command.
  • Commands like CHKDSK, SFC, or DISM may look stuck. But they just take more time, and interrupting them can cause more harm than good.

Furthermore, just make sure that you do not run commands you do not understand. If you are not sure, stop and check what the command does first. Otherwise, it may break your system.

How to Open the Command Prompt? (Step-by-Step for Beginners)

Accessing the Command Prompt on Windows is simple. Just follow these steps, and you can easily open and use the commands you have just learned about.

Step 1: Press the Windows key and type cmd on the search bar.

Step 2: Now, to view information or for basic use, just Enter and you will see a black window with a blinking cursor.

Step 3: If you want to use CMD for repairs, system fixes, or network resets, right-click on Command Prompt from the search results and select Run as administrator. 

Click on Run as Administrator

If the title bar says Administrator: Command Prompt, you are good to go. Skipping this step is the main reason beginners see “Access is denied” for many commands.

Command Prompt Administrator

Alternate Methods to Open Command Prompt: 

  • Press Windows + R, type cmd, and press Enter.
  • For admin mode: Press Windows + R, type cmd, and press Ctrl + Shift + Enter.
    Window R Type cmd Enter

Real-World Examples of Common Windows CMD Tasks

Let me show you that CMD is more than just theory. Below are some real problems people face and the exact commands that fix them.

1. Fix Corrupted Windows System Files

If Windows feels unstable, your apps crash randomly, or updates fail, this should be your first move. 

Open the command prompt as administrator, run the following command, and restart your computer:

DISM /Online /Cleanup-Image /RestoreHealth

sfc /scannow

DISM repairs the Windows image, and SFC replaces corrupted system files. With this, you can even fix the USB device not recognized error on Windows.

2. Fix “Connected but no internet” Issues

ipconfig /flushdns

netsh winsock reset

netsh int ip reset

This will clear the DNS cache and reset the network stack. Just run these Windows Command Prompt commands and restart.

3. Find Large Files Consuming Disk Space

dir C:\ /s /o:-s

This command lists your files from largest to smallest. You can use it to identify forgotten installers, logs, or backups, which are of no use now.

4. Kill a Frozen Application Instantly 

tasklist

taskkill /im appname.exe /f

Here, replace “appname.exe” with the actual process name. The best part is that this works even when Task Manager fails.

5. Check Disk Health 

chkdsk C: /f /r

You can use it to check disk health after improper shutdowns. If the drive is in use, Windows will ask to schedule the scan on reboot. Just type Y and restart.

6. Check Your IP Address and Network Details

ipconfig /all

Run the command and look at the IPv4 address, the default gateway, and the DNS servers. This command alone can solve many “internet not working” issues.

7. Check System Uptime

systeminfo

It can be useful when diagnosing memory leaks or slowdowns caused by long uptimes.

8. Quickly Navigate to a Deep Folder

cd “C:\Users\YourName\AppData\Local\Temp”

This is faster than clicking through hidden folders in File Explorer.

You don’t need to use Command Prompt every day. However, when Windows misbehaves, knowing these commands gives you control over your system instead of frustration.

Final Thoughts

One thing that you need to understand is that the Windows Command Prompt commands are not outdated; they are just misunderstood. 

Most Windows issues feel complex because the UI hides real system feedback. CMD removes that layer and shows you what is actually happening.

I have given you almost all the useful commands, but you don’t need to memorize hundreds of them. You just need to remember a few important ones, and understand why a command exists, when to use it, and how to read its output.

Frequently Asked Questions

How do I use Command Prompt?

Press the Windows key to open the Start menu and type ‘cmd’ in the search bar. Now, you can open the Command Prompt and start using the commands.

What is the shortcut key for Command Prompt?

Press Win + R, type cmd, then press Enter. Press Ctrl + Shift + Enter if you want to open it as administrator.

How do I list all commands in CMD?

Open Command Prompt, type ‘help’, and press Enter. This will display a list of key commands with a brief description of each command.

How can you view your IP address using the Command Prompt?

You can view your IP address by simply using the command “ipconfig” in the Command Line Interface.

Is CLI (Command Line Interface) faster than GUI (Graphical User Interface)?

Yes. Since the Command Line interface doesn’t include any kind of graphical elements, the processing and execution of the actions are much faster compared to the Graphical User Interface.

Is PowerShell better than CMD?

PowerShell is a similar new program of Windows. It is more powerful, but Command Prompt is still essential and simpler for many tasks.

How to fix a corrupt Windows using cmd?

Type SFC /scannow and press Enter. This triggers the System File Checker to inspect the integrity of all the system files and repair them.

How to fix a PC with the Command Prompt?

Start by using the SFC for system files, the DISM for the system image, and CHKDSK for disk errors.

Sources
Related Posts
Why Visual Merchandising Is Essential for Retail Business Growth

Visual merchandising plays a crucial role in shaping how customers experience a retail store. It goes beyond simply placing products…

What to Do After a Website Security Breach

A security breach doesn’t just break the code – it hits at the confidence and stability. Just a few seconds…

Top 7 AI Chatbot Solutions to Elevate Your Business in 2026

With 62% of consumers now preferring chatbots over waiting for human agents, AI chatbot solutions have become essential for modern…

Why Your Digital Privacy Matters When Recovering Lost Files

More than 70% of users have experienced data lossat some point, which makes this one of the most common issues…

Lessons from Operation Absolute Resolve for Software Developers

While the raid on January 3, 2026, was brief, it was preceded by several months of careful joint planning, including…

app ui
Why App Design Is Critical for User Retention and Engagement

The largest obstacle nowadays is not launching an app. However, retaining users’ interest after the download is. Many apps struggle…

SRE Consulting
Why SRE Consulting Services Are Shaping Modern Operational Strategies

Teams understand the value of reliability only when something goes wrong – an outage, a missed SLA or frustrated users.…

remote monitering system
A Full Guide to Implementation of Remote Monitoring Tech

At first, remote monitoring seemed like science fiction. At first, remote monitoring seemed like science fiction. The notion itself was…

agentic commrece
Agentic Commerce: Leading Vendors & Security Solutions

The practice of agentic commerce is well established. AI shopping is more than just a fad, as headlines like “AI…