Windows Commands Cheat Sheet
Windows CMD command reference — files, users, networking, services, and enumeration commands for admins and pentesters.
Overview
The classic Windows cmd.exe commands for files, users, services, and networking—still the fastest way to enumerate a Windows host on a foothold where PowerShell may be restricted. Includes the net, wmic, and tasklist commands you'll use during post-exploitation.
Authorized use only. Run commands only on systems you own or have permission to access.
Files & directories
List all files including hidden/system
dir /aRecursive search for matching paths
dir /s /b C:\ | findstr /i passwordPrint a file (like cat)
type file.txtCopy / move / delete files
copy / move / delFind files by name recursively
where /r C:\ *.kdbxGrep file contents for a string
findstr /si password *.xml *.ini *.txtUsers & groups
Current user, groups, and privileges
whoami /allList local users
net userDetails of a specific account
net user administratorMembers of the local admins group
net localgroup administratorsAdd a local admin (authorized testing/persistence)
net user hacker P@ss123 /add && net localgroup administrators hacker /addSystem & processes
OS version, patches, and hardware
systeminfoRunning processes and their services
tasklist /svcForce-kill a process
taskkill /F /PID 1234Installed patches (for missing-KB exploits)
wmic qfe get HotFixID,InstalledOnShow environment variables
setNetworking
Full network configuration
ipconfig /allConnections and listening ports with PIDs
netstat -anoARP cache — nearby hosts
arp -aRouting table (find other subnets)
route printBrowse / mount remote shares
net view \\TARGET / net use \\TARGET\C$ /user:dom\u pLocate domain controllers
nslookup -type=srv _ldap._tcp.dc._msdcs.corp.localServices & scheduled tasks
List services / inspect one's config
sc query / sc qc <service>Start / stop a service
sc start <service> / sc stop <service>List scheduled tasks (verbose)
schtasks /query /fo LIST /vCreate a task (authorized persistence)
schtasks /create /tn t /tr C:\Windows\Temp\p.exe /sc onlogonEnumeration one-liners
Search the registry for passwords
reg query HKLM /f password /t REG_SZ /sList saved credentials
cmdkey /listDump wireless passwords
netsh wlan show profile name="SSID" key=clearShow firewall state
netsh advfirewall show allprofilesList domain admins
net group "Domain Admins" /domainTips
- whoami /all is the single best first command — privileges like SeImpersonate lead straight to SYSTEM.
- Use findstr /si to grep files and reg query /s to grep the registry for credentials.
- net commands work even when PowerShell is locked down by Constrained Language Mode.
- wmic is deprecated on newer Windows — fall back to PowerShell Get-CimInstance if it's missing.