Guide to Windows CMD commands

In this guide, we will explore the most useful and important CMD commands that every Windows user should know. It doesn’t matter if you are a computer expert or a beginner venturing into the world of the command line for the first time.

Ready? Let’s get started.


ipconfig: provides your computer’s IP configuration information

ipconfig // Show IP information
ipconfig /all // Shows all IP configuration information
ipconfig /release // Releases all DHCP leases for all cards


ping: checks network connectivity to another host on the IP network

ping // Sends ping packets to
ping // Sends ping packets to IP address
ping -n 10 // Send 10 ping packets to


netstat: shows network connections (both incoming and outgoing), routing tables, and interface statistics

netstat // Show all active connections
netstat -a // Shows all connections and listening ports
netstat -r // Show the routing table


tracert: traces the path that network packets take from one host to another

tracert // Trace the path to
tracert // Traces the path to IP address
tracert -d // Trace the path to without resolving addresses to host names


nslookup: allows querying DNS servers to find DNS records for a domain

nslookup // Find DNS records for
nslookup -type=mx // Find MX record for
nslookup 8.8.8 // Find DNS record for using DNS server

sfc /scannow

sfc /scannow: scans system files for problems and attempts to repair them

sfc /scannow // Scans all system files and fixes errors


chkdsk: checks a disk or partition for errors and offers to fix them

chkdsk // Checks the C: drive for errors
chkdsk /f // Corrects errors on the disk
chkdsk D: /r // Finds bad sectors and recovers readable information


systeminfo: provides detailed information about your system

systeminfo // Shows basic system information

gpupdate /force

gpupdate /force: immediately enforces all changed group policies

gpupdate /force // Apply all changed group policies


diskpart: a powerful tool for managing your hard disk partitions

diskpart // Opens the diskpart utility


tasklist: shows all processes currently running on your system

tasklist // Shows all processes currently running
tasklist /v // Shows details of all running processes
tasklist /svc // Show related services for each process


taskkill: terminate a specific task

taskkill /im notepad.exe // Terminate all "notepad.exe" tasks
taskkill /pid 1234 // Terminate the task with the ID 1234
taskkill /im notepad.exe /t // Terminates "notepad.exe" and associated child processes


fc: compares two files and shows the differences between them

fc file1.txt file2.txt // Compare file1.txt and file2.txt


find: looks for a specific text string in a file

find "text" file.txt // Search for "text" in file.txt
find /v "text" file.txt // Show all lines that do not contain "text" in file.txt
find /i "text" file.txt // Search for "text" in file.txt ignoring the case-sensitive distinction

Remember that using the Command Prompt can have significant consequences if not used correctly. Before using any command, make sure you understand exactly what it does and how it might affect your system.

Leave a Reply