Table of Contents
Command Prompt is Windows' traditional command-line shell. It runs programs and built-in commands from typed instructions, which makes repeatable diagnostics and file tasks fast—but it also executes destructive commands immediately. Read the syntax and confirm the current folder before pressing Enter.

Open Command Prompt
- Open Start, type Command Prompt, and select it.
- Press Windows + R, enter
cmd, and press Enter. - Open Windows Terminal and select a Command Prompt profile.
Use Run as administrator only when a trusted instruction genuinely requires elevation. An elevated prompt can change protected system areas.
Understand the prompt and help
The text before the cursor is the current directory. Paths containing spaces must be quoted, such as dir "C:Program Files". Use command /? for built-in help—for example, robocopy /?. Press Tab to complete filenames and the up arrow to recall previous commands.

Safe commands for orientation
| Command | Purpose |
|---|---|
cd | Show or change the current directory |
dir | List files and folders |
type file.txt | Display a plain-text file |
systeminfo | Show Windows and hardware summary |
tasklist | List running processes |
driverquery | List installed drivers |
whoami | Show the current account context |
Network diagnostics
| Command | What it tells you |
|---|---|
ipconfig | Addresses for network adapters |
ipconfig /all | Detailed adapter, DHCP, DNS, and gateway data |
ping example.com | Whether echo replies arrive and their round-trip time; blocking replies does not prove a site is down |
tracert example.com | Visible hops toward a destination |
pathping example.com | Longer route and packet-loss sampling |
netstat -ano | Connections, listening ports, and process IDs |
nslookup example.com | DNS lookup results |
ipconfig /release drops a DHCP address; do not use it merely to view the current IP. ipconfig /renew requests a new lease and can interrupt connectivity.
Processes and shutdown
taskkill /PID 1234 asks a process to stop. Add /F only when necessary because forcing an app can lose unsaved work. To restart immediately, use shutdown /r /t 0; to shut down, use shutdown /s /t 0. Cancel a delayed action with shutdown /a.

Compare and copy files
fc "file1.txt" "file2.txt" compares text files; fc /b performs a binary comparison. For robust folder copying, learn robocopy and test with a small folder. A copy command can overwrite existing data, so quote paths and verify source and destination.
System diagnostics
powercfg /batteryreportcreates a battery report on supported laptops.powercfg /energyperforms an energy analysis and usually needs elevation.sfc /scannowchecks protected Windows files from an administrator prompt.DISM.exe /Online /Cleanup-Image /RestoreHealthrepairs the Windows component image before SFC when required.
Read the SFC and DISM guide before assuming every reported issue is fixed.

Commands that can destroy data
del, rd /s, format, diskpart, registry commands, permission changes, and forced process termination can remove files or break Windows. Command Prompt deletion bypasses the Recycle Bin. Never paste an unfamiliar command from a message or video, and never run an encoded or obfuscated command.
Command Prompt, PowerShell, and Terminal
Command Prompt interprets classic CMD syntax. PowerShell is a different shell with object-based commands and scripting. Windows Terminal is a host that can open either shell. Do not assume syntax copied for one works safely in another. For more navigation examples, see basic CMD commands.
Reader Comments 0
Sign in with email or Google to join the discussion.