70+ Essential Windows CMD Commands
File and Directory Commands
dir Lists files/directories.
:: Basic: List all files with details
dir /a
:: Advanced: Find specific file types recursively
dir *.txt /s /pcd Changes directory.
:: Basic: Navigate to a folder
cd C:\Users
:: Advanced: Switch to path with spaces
cd "C:\Program Files (x86)"mkdir/md Creates a directory.
:: Basic: Create a single folder
mkdir Data
:: Advanced: Create nested folders
mkdir Parent\Child\Grandchildrmdir/rd Deletes a directory.
:: Basic: Remove empty folder
rmdir Data
:: Advanced: Delete non-empty folder
rmdir /s /q Datadel Deletes files.
copy Copies files.
xcopy Extended copy for files/directories.
move Moves/renames files.
attrib Changes file attributes.
ren Renames files/directories.
System Information Commands
systeminfo Shows system configuration.
hostname Shows computer name.
ver Shows Windows version.
set Manages environment variables.
wmic Performs system admin tasks.
whoami Shows current user.
tasklist Lists running processes.
Network Commands
ipconfig Shows IP configuration.
ping Tests network connectivity.
tracert Traces route to a host.
netstat Shows connections/ports.
nslookup Queries DNS.
arp Manages ARP cache.
route Manages routing table.
net use Maps network drives.
netstat -an Shows connections numerically.
netsh Configures network settings.
Disk and Drive Commands
chkdsk Checks/repairs disk errors.
diskpart Manages disks/partitions.
format Formats a drive.
label Sets volume label.
vol Shows volume info.
fsutil Manages file system.
Task and Process Management Commands
taskkill Terminates processes.
Investigation Context: Detect malicious
taskkilluse (e.g., targetingMsMpEng.exe) in Defender XDR/Sentinel.
schtasks Manages scheduled tasks.
sc Controls services.
shutdown Performs shutdown/restart/logoff.
start Starts program in new window.
pause Pauses batch file.
timeout Adds delay in scripts.
User and Security Commands
net user Manages user accounts.
net localgroup Manages group memberships.
runas Runs program as another user.
cacls Modifies file permissions.
icacls Advanced file permissions.
lock Locks workstation.
gpupdate Updates Group Policy.
secedit Applies security templates.
Power and Shutdown Commands
powercfg Manages power settings.
shutdown /s /t 0 Immediate shutdown.
shutdown /r /t 0 Immediate restart.
shutdown /l Logs off user.
Windows Troubleshooting Commands
sfc /scannow Repairs system files.
DISM Repairs Windows images.
cleanmgr Launches disk cleanup.
eventvwr Opens Event Viewer.
msinfo32 Shows system info.
Advanced and Miscellaneous Commands
tree Displays folder structure.
echo Displays messages or toggles echoing.
cls Clears CMD screen.
title Sets CMD window title.
color Changes CMD colors.
exit Closes Command Prompt.
prompt Changes CMD prompt.
help Shows command help.
CMD Scripting and Batch Commands
if Conditional logic in scripts.
for Loops through values.
goto Jumps to labeled line.
call Calls another script/function.
setlocal / endlocal Manages variable scope.
Bonus Useful Commands
clip Redirects to clipboard.
find Searches text in files.
assoc Manages file associations.
driverquery Lists installed drivers.
taskview Opens Task View.
Last updated