10 Windows Command Prompt (CMD) Commands You Must Know

The Windows Command Prompt (CMD) is a powerful tool for system administration, troubleshooting, and automation. Whether you're a sysadmin, developer, or power user, these 10 essential CMD commands will help you work more efficiently.

1. ipconfig - Network Configuration

ipconfig displays and manages network configuration. Use it to check your IP address, release/renew DHCP leases, and flush DNS cache.

ipconfig /all

Shows detailed network adapter information

ipconfig /flushdns

Clears DNS resolver cache (useful for connectivity issues)

2. ping - Network Connectivity Test

ping tests connectivity to another network device. Essential for troubleshooting network issues.

ping google.com

Tests connection to Google servers

ping -t 192.168.1.1

Continuous ping until stopped (Ctrl+C)

3. tracert - Trace Network Route

tracert shows the path packets take to reach a destination, displaying each hop along the way.

tracert google.com

Shows route to Google with latency at each hop

4. netstat - Network Statistics

netstat displays active network connections, ports, and routing tables. Great for security auditing.

netstat -an

Shows all active connections and listening ports

5. tasklist & taskkill - Process Management

tasklist shows running processes. taskkill terminates unresponsive applications.

tasklist

Lists all running processes with PID

taskkill /PID 1234 /F

Forcefully terminates process with PID 1234

6. chkdsk - Disk Check

chkdsk scans and repairs disk errors. Run it periodically to maintain drive health.

chkdsk C: /f

Checks and fixes errors on C: drive

7. sfc - System File Checker

sfc scans and repairs corrupted Windows system files. Run as Administrator.

sfc /scannow

Scans all protected system files and repairs

8. diskpart - Disk Partition Management

diskpart is a powerful disk management tool. Use with caution - it can erase drives.

diskpart

Opens disk partition tool (interactive)

9. systeminfo - System Information

systeminfo displays detailed system configuration including OS version, hardware, and uptime.

systeminfo

Shows complete system details

10. Robocopy - Robust File Copy

robocopy is a powerful file copying tool with resume capability, perfect for large transfers.

robocopy C:\\Source D:\\Backup /E /R:3 /W:5

Copies all files/subfolders with 3 retries, 5 second wait

Bonus: Quick CMD Tips

  • Ctrl + C - Cancel current command
  • Tab - Auto-complete file/folder names
  • Up/Down arrows - Cycle through command history
  • cls - Clear the screen
  • exit - Close CMD window

How to Open Command Prompt as Administrator

  1. Press Windows + X
  2. Select Command Prompt (Admin) or Windows Terminal (Admin)
  3. Or search "cmd" in Start menu, right-click, select "Run as administrator"

Conclusion

These 10 CMD commands cover essential system administration tasks. Master them to troubleshoot network issues, manage processes, maintain disk health, and automate tasks. For more advanced users, consider exploring PowerShell for even more powerful scripting capabilities.