Common CMD Commands

Common CMD Commands

The Windows Command Prompt (CMD) has been an essential tool for IT professionals, developers, and power users for decades. With just a few keystrokes, you can test network connectivity, analyze system performance, manage users, or troubleshoot common issues — all without opening a single graphical window.

In this article, we will explore the most commonly used CMD commands, along with practical examples such as ping, tasklist, tracert, and nslookup. These commands are not only useful for day-to-day troubleshooting but also form the foundation for deeper system administration and automation tasks.

CommandDescription
ping [ip/domain]Test network connectivity
tracert [ip/domain]Packet route (hop tracing)
nslookup [domain]DNS resolution
ipconfigIP information
ipconfig /allDetailed network information
ipconfig /renewRenew IP address
ipconfig /releaseRelease IP address
arp -aARP table
getmacMAC address
netstat -anoPorts, connections, and PID info
netstat -rnRouting table
netstat -sProtocol statistics
pathping [ip/domain]Packet loss + latency test
telnet [ip] [port]Port connectivity test
netsh wlan show profileSaved Wi-Fi profiles
netsh wlan show profile name=”SSID” key=clearDisplay Wi-Fi password
route printRouting table
ftp [ip]FTP connection
hostnameComputer name
whoamiCurrent logged-in user
taskmgrTask Manager
msconfigSystem configuration
services.mscServices management
eventvwr.mscEvent viewer (logs)
gpedit.mscGroup Policy Editor
regeditRegistry Editor
compmgmt.mscComputer Management
diskmgmt.mscDisk Management
devmgmt.mscDevice Manager
cleanmgrDisk cleanup
dxdiagDirectX information
verifierDriver verification
driverqueryList installed drivers
sfc /scannowSystem file repair
chkdsk /fFix disk errors
systeminfoSystem information (OS, patch level)
wmic product get nameList installed programs
wmic os get captionWindows version
echo %username%Display username
echo %computername%Display computer name
net userList user accounts
net user [username] [password] /addAdd new user
net localgroup administrators [username] /addGrant admin rights
gpupdate /forceRefresh group policies
shutdown -s -t 30Shutdown in 30 seconds
shutdown -r -t 0Restart immediately
shutdown -lLog off user
shutdown -iRemote shutdown dialog
logoffLog off session
clsClear console screen

Example: ping <code>google.com

The ping command is one of the most commonly used CMD commands. It is used to test the connectivity between your computer and another host (such as a website or IP address).

In the example:

  • The command sends 4 ICMP packets (by default) to google.com.
  • The replies show:
    • Reply from [IP address] → The destination is reachable.
    • bytes=32 → Packet size (32 bytes).
    • time<1ms → Response time (latency), here less than 1 millisecond.
    • TTL=64 → Time to Live, indicating how many hops (routers) the packet can still pass through.

At the end, statistics are shown:

  • Packets: Sent = 4, Received = 4, Lost = 0 → No packet loss, the connection is stable.
  • Round Trip Times (Minimum, Maximum, Average) → Shows network speed and latency consistency.

In this case, the connection to Google is successful, with 0% packet loss and extremely low latency.

Example: tasklist

The tasklist command displays all currently running processes on a Windows system. It is very useful for monitoring system activity, troubleshooting, and identifying resource usage.

In the example above:

  • Image Name → The name of the running process (e.g., svchost.exe, dwm.exe).
  • PID (Process ID) → A unique identifier assigned to each running process.
  • Session Name / Session# → Indicates whether the process is running under the system services or a user session.
  • Mem Usage → Shows the amount of memory (RAM) the process is currently using.

Why use tasklist?

  • To check which applications or background services are running.
  • To find memory-hungry processes that may slow down the system.
  • To get the PID number, which can be used later with commands like taskkill to end a process.

This makes tasklist a powerful tool for system administrators and developers who need quick insights into what is happening on the machine.

Example: tracert google.com

The tracert (Trace Route) command is used to determine the path that packets take to reach a destination (such as a website or server). It shows each “hop” the packet passes through along the way.

In the example above:

  • The destination IP address is 142.250.184.206.
  • The trace shows that the packets reached the target in just 1 hop with a response time of <1ms.
  • The hostname fra24s11-in-f14.1e100.net indicates that the server is located in Google’s infrastructure (Frankfurt, Germany in this case).

Why use tracert?

  • To identify network routing paths.
  • To troubleshoot slow connections by checking where latency occurs.
  • To see if a connection problem happens on your local network, your ISP, or beyond.

In this case, the connection to Google completed successfully with almost no delay.

Example: nslookup google.com

The nslookup (Name Server Lookup) command is used to query DNS servers to obtain the IP address of a domain name. It is very useful for troubleshooting DNS-related issues.

In the example above:

  • The DNS server used is 1.1.1.1 (Cloudflare DNS).
  • The command resolved the domain google.com to the following IP addresses:
    • IPv6: 2a00:1450:4001:831::200e
    • IPv4: 142.250.185.110

Why use nslookup?

  • To check if a domain name resolves correctly to an IP address.
  • To verify DNS server responses.
  • To troubleshoot network connectivity problems related to DNS.

In this case, google.com correctly resolves to both IPv4 and IPv6 addresses, confirming that the DNS resolution works as expected.

Learn more about our services here.

Contact us today to keep your ERP running at peak performance and reliability.here.