Windows Commands
Executive Summary
This cheatsheet is a quick reference for Windows command-line enumeration, files, users, groups, processes, services, networking, registry, and logs.
Use it during labs, administration, troubleshooting, and security investigations.
System Information
Show Windows version:
Detailed system information:
Show hostname:
Show current user:
Show current user privileges:
Show current user groups:
Show environment variables:
Filesystem Navigation
Print current directory:
List files:
List hidden files:
Recursive directory listing:
Change directory:
Show directory tree:
File Viewing and Searching
View file contents:
Search for text:
Search recursively:
Count lines:
Find files by name:
Users and Groups
List local users:
Show user details:
List local groups:
Show local administrators:
List domain users:
List domain groups:
Show domain group members:
Processes
List processes:
Show services inside processes:
Verbose process list:
Kill process by name:
Kill process by PID:
Show process command lines:
Services
List services:
Query service:
Start service:
Stop service:
Show service processes:
Networking
Show IP configuration:
Show DNS cache:
Show routing table:
Show ARP table:
Show active connections:
Show listening ports:
Ping host:
Trace route:
DNS lookup:
Shares and Sessions
List local shares:
List visible network hosts:
List domain hosts:
List remote shares:
Connect to share:
Disconnect share:
Show active sessions:
Registry
Query registry key:
Search registry for password:
Add registry value:
Delete registry value:
Important Run keys:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
Event Logs
List logs:
Query recent Security events:
Query logon events:
Query failed logons:
Scheduled Tasks
List scheduled tasks:
Query specific task:
Create task:
Delete task:
File Transfer
Download with Certutil:
Copy from SMB share:
Map SMB drive:
Copy file to share:
Useful Paths
| Path | Purpose |
|---|---|
C:\Windows\System32\drivers\etc\hosts |
Hosts file |
C:\Windows\System32\config\SAM |
Local account database |
C:\Windows\System32\config\SYSTEM |
System registry hive |
C:\Windows\Temp\ |
System temp directory |
C:\Users\<user>\AppData\Local\Temp\ |
User temp directory |
C:\Users\Public\ |
Public user directory |
C:\ProgramData\ |
Shared application data |
%APPDATA% |
User roaming profile data |
%USERPROFILE% |
Current user profile |
Notes
- Use
whoami /privandwhoami /groupsearly during enumeration. netstat -anogives PIDs; match them withtasklist.- Registry searches can be noisy and slow.
- Some commands require administrator privileges.
- Event logs and command-line auditing are important defensive data sources.