Windows CMD Commands List: 70+ Essential Commands With Examples and Safety Notes
Discover over 70 vital Windows CMD commands every user should know, from basic file operations to advanced system administration tools. This guide explains how to use each command with clear categories, practical use cases, and a reference table, making it ideal for beginners, IT professionals, and system administrators who want to boost productivity and take full control of their Windows environment.
Quick answer: Essential Windows CMD commands include dir, cd, copy, robocopy, ipconfig, ping, tracert, nslookup, netstat, tasklist, taskkill, chkdsk, sfc /scannow and net user. Add /? to any command for help. Be careful with del /s, format, diskpart clean, reg delete and bcdedit, which can destroy data or stop Windows booting.
Key takeaways
- Learn commands by group: files, system, network, disk, processes, users and repair.
- ipconfig, ping, tracert and nslookup form a quick network troubleshooting sequence.
- Know the destructive commands: del /s, format, diskpart clean, reg delete, bcdedit.
- wmic is deprecated; PowerShell is better for automation.
How do you use this list?
Open Command Prompt from the Start menu. For commands marked "admin", right-click it and choose Run as administrator. Add /? to any command, for example robocopy /?, to see its built-in help. This list covers the commands worth knowing, in groups, with a note where a command can hurt you.
Files and folders
| Command | What it does | Example |
|---|---|---|
dir | List files and folders | dir /a (include hidden) |
cd | Change folder | cd C:\Users; cd /d D:\ to switch drive |
cd.. | Go up one level | cd.. |
md / mkdir | Create a folder | mkdir reports |
rd / rmdir | Remove an empty folder (/s removes contents too: dangerous) | rmdir old |
copy | Copy files | copy a.txt b.txt |
xcopy | Copy folders and trees | xcopy src dest /e /i |
robocopy | Reliable copy tool for large jobs and backups | robocopy C:\data D:\backup /e |
move | Move or rename | move a.txt D:\ |
ren / rename | Rename | ren old.txt new.txt |
del / erase | Delete files (no Recycle Bin) | del file.txt |
type | Show a text file | type log.txt |
more | Page through output | type big.txt | more |
find | Search for text in files | find "error" log.txt |
findstr | Search with patterns | findstr /i /s "timeout" *.log |
tree | Show folder structure | tree /f |
attrib | Show or change file attributes | attrib +h secret.txt |
fc | Compare two files | fc a.txt b.txt |
mklink | Create a symbolic link | mklink link.txt target.txt |
cls | Clear the screen | cls |
System information
| Command | What it does | Example |
|---|---|---|
ver | Windows version | ver |
systeminfo | Detailed system and patch information | systeminfo |
hostname | Computer name | hostname |
whoami | Current user (/groups shows groups) | whoami /groups |
set | Show environment variables | set PATH |
wmic | Legacy hardware and OS queries; deprecated, use PowerShell instead | wmic cpu get name |
driverquery | List installed drivers | driverquery |
date / time | Show or set date and time | date /t |
echo | Print text or set echo in scripts | echo Hello |
help | List commands or show help | help copy |
Networking
| Command | What it does | Example |
|---|---|---|
ipconfig | IP settings (/all for details, /release and /renew for DHCP, /flushdns to clear DNS cache) | ipconfig /all |
ping | Test reachability | ping 8.8.8.8 |
tracert | Trace the route to a host | tracert example.com |
pathping | Trace plus packet loss per hop | pathping example.com |
nslookup | Query DNS | nslookup example.com |
netstat | Connections and listening ports | netstat -ano |
arp | ARP table | arp -a |
route | Show or edit the routing table | route print |
getmac | MAC addresses | getmac /v |
netsh | Configure network components, Wi-Fi and firewall | netsh wlan show profiles |
net use | Map or disconnect network drives | net use Z: \\server\share |
nbtstat | NetBIOS information | nbtstat -n |
A good first troubleshooting sequence for "no internet": ipconfig /all (is there an address and gateway?), ping the gateway, ping 8.8.8.8, then nslookup example.com. Each step tells you which layer is failing.
Disks and drives
| Command | What it does | Example |
|---|---|---|
chkdsk | Check a drive for errors | chkdsk C: /f (needs admin, may need reboot) |
diskpart | Disk partitioning tool; powerful and dangerous | diskpart then list disk |
format | Format a drive: erases data | format E: /fs:ntfs |
vol | Show a drive's label and serial number | vol C: |
label | Change a drive label | label E: DATA |
fsutil | File system utilities | fsutil volume diskfree C: |
defrag | Optimise drives (/O) | defrag C: /O |
cleanmgr | Open Disk Cleanup | cleanmgr |
compact | Compress files on NTFS | compact /c file.txt |
Processes, services and tasks
| Command | What it does | Example |
|---|---|---|
tasklist | List running processes | tasklist /fi "imagename eq chrome.exe" |
taskkill | End a process | taskkill /pid 1234; /f forces it |
start | Launch a program or file | start notepad |
sc | Manage services | sc query |
net start / net stop | Start or stop a service | net stop spooler |
schtasks | Create and manage scheduled tasks | schtasks /query |
at | Old task scheduler; use schtasks | - |
perfmon | Open Performance Monitor | perfmon |
eventvwr | Open Event Viewer | eventvwr |
wevtutil | Query event logs | wevtutil qe System /c:5 /f:text |
Users, permissions and policy
| Command | What it does | Example |
|---|---|---|
net user | List or manage local users | net user |
net localgroup | Manage local groups | net localgroup administrators |
runas | Run a program as another user | runas /user:admin cmd |
icacls | Show or change file permissions | icacls C:\data |
takeown | Take ownership of a file | takeown /f file.txt |
gpupdate | Refresh Group Policy | gpupdate /force |
gpresult | Show applied policies | gpresult /r |
cipher | Encrypt files or wipe free space (/w is slow and destructive) | cipher /? |
klist | Kerberos tickets | klist |
Repair, power and miscellaneous
| Command | What it does | Example |
|---|---|---|
sfc /scannow | Check and repair protected system files | Run as administrator |
DISM /Online /Cleanup-Image /RestoreHealth | Repair the Windows image, then run sfc again | Run as administrator |
shutdown | Shut down or restart (/s, /r, /t seconds, /a aborts) | shutdown /r /t 60 |
bcdedit | Boot configuration: wrong changes can stop Windows booting | bcdedit /enum |
reg | Read or edit the registry | reg query HKCU\Software |
powercfg | Power settings and battery report | powercfg /batteryreport |
msinfo32 | System Information window | msinfo32 |
winver | Show Windows version dialog | winver |
mstsc | Remote Desktop client | mstsc /v:server |
assoc / ftype | File type associations | assoc.txt |
title, color, prompt | Customise the console | color 0a |
What are the commands that can destroy data or break Windows?
Read the help and be certain of the target before running these.
del /s /qandrd /s /qdelete without asking and skip the Recycle Bin.formatanddiskpartwithcleanwipe drives. A wrong disk number is unrecoverable.reg deleteand carelessreg addcan break applications or Windows itself. Export a key first withreg export.bcdeditchanges can leave the PC unbootable.taskkill /fon system processes can crash Windows.cipher /woverwrites free space and takes a long time.shutdown /r /t 0restarts immediately and unsaved work is lost.
Pipes, redirection and a tiny batch file
Use > to send output to a file, >> to append, and | to pass output to another command.
ipconfig /all > C:\temp\net.txt
tasklist | findstr /i "chrome"
A simple backup script saved as backup.bat:
@echo off
set SRC=C:\Users\%USERNAME%\Documents
set DST=D:\Backup\Documents
robocopy "%SRC%" "%DST%" /e /r:2 /w:5
echo Done at %date% %time%
CMD or PowerShell?
CMD is fine for quick tasks and old scripts. PowerShell works with objects, has far more features and is what Microsoft develops for administration, and some older tools such as wmic are deprecated. Learn both: CMD for speed, PowerShell for automation. Microsoft's documentation is at Microsoft Learn.
Next steps
For Linux commands, see the top 100 Linux commands and the Linux command cheat sheet. To turn command-line skills into a career, see the Computer Network course.
Related reading
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0