Beginner 7 min read Updated: Sep 09, 2026

Windows Command Prompt Basics

Master essential Windows CMD commands for file navigation, system configuration, network diagnostics, and administrator maintenance.

The Windows Command Prompt (cmd.exe) remains an indispensable tool for IT support engineers, system administrators, and infrastructure technicians. While PowerShell provides deep object-oriented scripting, CMD provides rapid, lightweight access to native utilities across every version of Windows without execution policy restrictions.

Understanding Standard vs Elevated Privileges

Windows User Account Control (UAC) runs Command Prompt sessions in standard user context by default. Commands modifying system state, repairing file system integrity, or adjusting firewall rules require an Elevated Command Prompt (Run as Administrator):

  • Standard Context: Read-only operations, user profile directory navigation, basic network reachability tests (ping, tracert).
  • Elevated Context: Disk repair (chkdsk), servicing repairs (sfc, dism), network stack resets (netsh), and service state changes (net start/stop).

Filesystem Navigation & Directory Control

CMD utilizes drive letters and standard pathing syntax. Unlike Unix environments, drive letter changes require entering the drive letter directly rather than using cd:

REM Switch from C: to D: drive D: REM Change directory to Windows logs folder cd C:\Windows\System32\winevt\Logs REM List directory contents with file size and timestamp dir /a /o:d REM Create a new administrative maintenance directory mkdir C:\Support\Diagnostics
Command Syntax / Arguments Primary Administrative Purpose
cd cd /d D:\Logs Change directory (use /d to change drive and directory simultaneously)
dir dir /a:h /s Display directory contents, including hidden files and subdirectories
mkdir / rmdir rmdir /s /q temp_dir Create or remove directories recursively in quiet mode
del del /f /q filename Delete files with force override on read-only files

System Information & Process Inspection

When triaging a newly assigned server or workstation, gather operating system build details, BIOS version, memory totals, and active task lists directly:

REM Display comprehensive OS build, memory, hotfixes, and NIC details systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"Total Physical Memory" REM Display active processes sorted by memory usage tasklist /fi "memusage gt 100000" REM Terminate an unresponsive application by process name taskkill /im notepad.exe /f

Network Diagnostics in CMD

CMD hosts the core networking troubleshooting tools used in day-to-day help desk and NOC operations:

  • ipconfig /all: Displays full TCP/IP configuration including DHCP lease dates, DNS servers, and MAC addresses.
  • ipconfig /flushdns: Clears the local DNS resolver cache to enforce new record lookups.
  • ping -n 4 -l 1000 8.8.8.8: Tests IP reachability and detects MTU fragmentation issues.
  • tracert -d 1.1.1.1: Traces router hops without performing reverse DNS lookups, speeding up path discovery.

System Health & Image Repair: SFC and DISM

When Windows experiences system file corruption or application crashes following an update, administrators deploy System File Checker and Deployment Image Servicing and Management:

REM 1. Check and repair the Windows Component Store image online DISM.exe /Online /Cleanup-image /Restorehealth REM 2. Scan and repair protected operating system files against known good cache sfc /scannow

Warning: Always execute DISM prior to SFC if corruption is suspected. SFC relies on the local Windows Component Store cache (WinSxS); if the store itself is corrupted, SFC will fail to repair affected system binaries.

Summary

Command Prompt remains a core administrative utility across Windows client and server operating systems. Mastering directory navigation, process management with tasklist and taskkill, network diagnostics with ipconfig, and recovery routines with sfc and dism provides immediate diagnostic leverage in enterprise troubleshooting.

Code copied to clipboard!