Windows CLI¶
1. System Information and Environment Management¶
set¶
-
Description: Displays, sets, or removes environment variables.
-
Use Case: View system variables like
PATH,USERNAME,TEMP. -
Example:
(Lists all or a specific environment variable)
ver¶
-
Description: Displays the current version of Windows.
-
Use Case: Verify OS version.
-
Example:
(Example Output:
Microsoft Windows [Version 10.0.19045.3930])
systeminfo¶
-
Description: Displays detailed configuration and system info.
-
Use Case: Get specs like BIOS version, RAM, domain, hotfixes.
-
Example:
help¶
-
Description: Lists all available internal commands and syntax.
-
Use Case: Learn about a command’s usage quickly.
-
Example:
cls¶
-
Description: Clears the terminal screen.
-
Use Case: Clean up messy output before new commands.
-
Example:
2. Network Commands¶
ipconfig¶
-
Description: Displays IP configuration for network interfaces.
-
Use Case: Troubleshoot network connectivity.
-
Example:
ping¶
-
Description: Sends ICMP packets to test connectivity.
-
Use Case: Check if a host is reachable.
-
Example:
tracert¶
-
Description: Traces the route to a network host.
-
Use Case: Identify network bottlenecks or latency.
-
Example:
nslookup¶
-
Description: Queries DNS servers.
-
Use Case: Check domain name resolution or DNS configuration.
-
Example:
netstat¶
-
Description: Displays current TCP/UDP connections and ports.
-
Use Case: Analyze active connections or detect malware communication.
-
Options:
-
-a: Show all active connections and listening ports. -
-b: Show executable responsible for each connection. -
-n: Use numeric IPs and ports. -
-o: Display the Process ID (PID). -
-h: Display help.
-
-
Examples:
3. Directory & File Operations¶
cd (Change Directory)¶
-
Description: Navigate between directories.
-
Example:
dir¶
-
Description: Lists contents of the current directory.
-
Options:
-
/a: Shows hidden and system files. -
/s: Shows contents recursively.
-
-
Example:
tree¶
-
Description: Graphically displays folder structure.
-
Use Case: Visualize nested folders.
-
Example:
mkdir / md¶
-
Description: Creates a new folder.
-
Example:
rmdir / rd¶
-
Description: Deletes a folder (only if it's empty).
-
Example:
type¶
-
Description: Displays content of text files.
-
Example:
move¶
-
Description: Moves files/folders to another location.
-
Example:
del or erase¶
-
Description: Deletes files.
-
Use Case: Delete temporary or outdated files.
-
Example:
copy (with wildcard)¶
-
Description: Copies files, can use wildcards (
*) for batch copying. -
Example:
4. Task and Process Management¶
tasklist¶
-
Description: Lists all running processes.
-
Use Case: Identify running tasks, check memory usage.
-
Filter Syntax:
taskkill¶
-
Description: Terminates a running process using PID or image name.
-
Example:
5. System Health & Diagnostics¶
chkdsk¶
-
Description: Checks disk for file system errors and bad sectors.
-
Example:
driverquery¶
-
Description: Lists all installed device drivers.
-
Example:
sfc /scannow¶
-
Description: Scans and repairs corrupted system files.
-
Example:
6. Shutdown & Restart Management¶
shutdown¶
- Purpose: Shuts down, restarts, logs off, or hibernates the system.
| Command | Description |
|---|---|
shutdown /s |
Shutdown system |
shutdown /r |
Restart system |
shutdown /h |
Hibernate system |
shutdown /l |
Log off current user |
shutdown /a |
Abort scheduled shutdown |
-
Example: