Windows Command Line Cheat Sheet
Various windows commands are really helpful. We can execute them using Command Prompt. Basically, almost every process that you can do using the UI of windows, you can do that by entering some specific commands on CMD.
However, most of us are not aware of these commands and their usefulness. That is why we have compiled all the Windows Commands on this cheat sheet.
- If you want to see the list of processes currently running, write tasklist on the command line and press Enter.
- If you want to see the processes and all the DLL files they have loaded, enter tasklist /m on the command line and press Enter.
- If you want to see which processes have loaded a specific DLL file, type tasklist /m [dllname] and press Enter.
- To see which processes are running and which services have been hosted by them, type tasklist /svc.
- To ask for the brief statuses of all services, type sc query.
- If you want to query the configuration of a specific device, type: sc qc [ServiceName].
- To add any key to the registry on your machine, you can use
reg add [\TargetIPaddr][RegDomain][Key]
command. The targetIPaddr determines the location of the system. The RegDomain is the registry domain where the key is located.
- To export any registry, you can use
reg export [RegDomain] [Key][FileName].
This exports all subkeys and values located in that domain to a specific location [Key] present in the file [FileName].
- To import any registry entries from a specific file
reg import [FileName].
- If you want to ask for the value of a specific key, type
reg query [\TargetIPaddr] [RegDomain] [Key] /v [ValueName].
- To shut down Windows immediately, press
shutdown /s /t 0
[This will shut down your Operating System but may not power down your hardware.]
- To restart Windows immediately, type shutdown /r /t 0.
- If you have a countdown running for shutting down or restarting your Windows, you can cancel them using shutdown /a.
- If you want to see all TCP and UDP port usage and process IDs, use netstat -nao.
- To check the usage of a port at a specific time interval, n, use the command
netstat -nao [n] | find [port].
- To dump all the detailed protocol statistics, type
netsat -s -p [tcp|udp|ip|icmp]
- If you want to install telnet services on Windows Vista:
pkgmgr /iu: “TelnetServer”
- If you want to install telnet clients in Windows Vista, type
pkgmgr /iu: “TelnetClient”
- If you want to find the directory structure for a file located in a specific directory, type
dir /b /s [Directory][FileName].
- To count the number of lines present on StandardOuy of [Command], type
[Command] | find /c /v “”.
This command count (/c) the number of lines which does not contain (/v) NULL (“”). These lines which have no contents are also considered as lines, so they need to be excluded manually.
- If you want to open the User Manager that includes group management, enter
- If you want to open the service control panel, type
- To open the task manager, type taskmgr.exe.
- To open the security policy manager, type secpol .msc.
- To open Windows Event Viewer, type eventvwr .msc.
- To open the control panel, type control on the command line.
- If you want to turn off Windows’ built-in firewall, type
netsh firewall set opmode disable
- To configure the interface of Local Area Connections (LAN) using [IPaddr] [Netmask] [DefaultGW], type
netsh interface ip set address local static [IPaddr] [Netmask] [DefaultGW] 1
- If you want to configure the interface to use DCHP:
netsh interface ip set address local dchp.
Other useful articles:
- Basic Windows CMD commands
- Cool CMD Commands Tips and Tricks
- Best CMD Commands for Hacking
- CMD Commands for Wireless Network Speed
- Useful Keyboard Shortcuts for CMD
- What Info about My Laptop Can I Check with CMD and How?
- Getting Started with CMD Windows
- TOP-12 Command-Line Interview Questions (Basic)
- Command-Line Interview Questions (Advanced)
- CMD Commands to Repair Windows
- CMD Commands to Speed Up Computer
- CMD Commands for MAC OS
- How Does the Command Line Work?
- MS-Dos Interview Questions in 2021
- Windows OS Versions and History
- Recent Windows Versions Compared
- Basic Windows Prompt Commands for Every Day
- Windows Command Line Cheat Sheet For Everyone
- Windows Command Line Restart
- Windows Command Line for Loop
- Windows Command - Change Directory
- Windows Command - Delete Directory
- Windows Command Line – Set Environment Variable