How to use the Windows CMD Commands Cheat Sheet
- Type your own values (folder, file, host) in the boxes at the top — every example on the page updates instantly.
- Search or jump to a section to find the command you need.
- Click Copy to copy a ready-to-run line, or Copy section for a commented block.
- Commands marked destructive delete or overwrite data — read the note before running them.
When to use CMD
PowerShell is the modern Windows shell, but Command Prompt is still everywhere: batch files, installers, recovery mode and many documentation snippets assume cmd.exe. Its commands are short and stable — ipconfig, robocopy, sfc and netstat have worked the same way for decades — and they also run inside PowerShell.
Batch file gotchas
Inside a .bat file, loop variables need two percent signs (%%f instead of %f). Variables set inside a parenthesised block need setlocal EnableDelayedExpansion and !var! syntax to see their new value. Save batch files with CRLF line endings — the line ending converter fixes files edited on macOS or Linux.
Run as administrator
Repair and system commands such as sfc, DISM, chkdsk and service changes need an elevated prompt: search for “cmd”, right-click and choose Run as administrator. Compare with the PowerShell cheat sheet.
Tools that pair well with the Windows CMD Commands Cheat Sheet
- Linux Commands Cheat Sheet — The Linux and bash commands developers use on servers and laptops — files, search, permissions, processes, logs, networking and SSH.
- Windows Path Converter — Paste a path in any format — C:\Users\me\project, /mnt/c/Users/me/project, /c/Users/me — and get it in every other form, ready to copy: WSL, Git Bash, Cygwin, file URL, UNC and escaped for code.
- Git Cheat Sheet — Every Git command you use day to day — and the ones you need when something goes wrong — explained in one line.
- Docker Cheat Sheet — The Docker and Docker Compose commands you reach for every week, explained in one line.
Frequently asked questions
How do I find which program is using a port?
netstat -ano | findstr :3000 to get the PID, then tasklist | findstr PID or end it with taskkill /pid PID /f.What is the difference between xcopy and robocopy?
How do I see a saved Wi-Fi password?
netsh wlan show profile name="NetworkName" key=clear — the password is shown as “Key Content”.