The command line is the "master key" for troubleshooting Windows. Many problems (no network, corrupted system files, disk errors, checking specs) are faster typed than clicked. This is organized by scenario, so bookmark it.
1. How to open the command line
Win + R> typecmd(Command Prompt) /powershell/wt(Windows Terminal).- Right-click the Start menu > Terminal (admin).
- Commands that need admin rights (
sfc,chkdsk,diskpart) must run as administrator or they fail.
2. Network diagnostics (most frequent)
ipconfig :: see IP/gateway/DNS
ipconfig /release :: release IP
ipconfig /renew :: renew IP
ipconfig /flushdns :: clear DNS cache
ping 8.8.8.8 :: test connectivity
ping www.baidu.com :: test DNS resolution
tracert www.baidu.com :: trace route
netstat -ano :: see port usage (who holds 80/443)
netsh winsock reset :: reset Winsock
netsh int ip reset :: reset TCP/IP
The PowerShell equivalent of ping is Test-NetConnection www.baidu.com. For network issues see Browser Can't Open Web Pages, but WeChat Works.
3. System files and disk
sfc /scannow :: verify and repair system files
chkdsk /f /r :: check and fix disk errors (needs restart)
diskpart :: partition/format (dangerous, use with care)
shutdown /s /t 0 :: shut down immediately
shutdown /r /t 0 :: restart immediately
shutdown /a :: cancel a pending shutdown
cipher /w:C :: securely wipe free space on C
robocopy source dest /E /R:1 /W:1 :: copy large files/folders (more reliable than xcopy)
For chkdsk and disk topics see the disk troubleshooting articles; for shutdown see Windows Won't Shut Down.
4. Processes, users, services, info
tasklist :: list processes
taskkill /im name.exe /f :: force-end a process
net user :: list accounts
net user username password /add :: create an account (admin)
gpupdate /force :: refresh group policy
systeminfo :: system overview
For a clearer view of specs, use msinfo32 or dxdiag; see How to Check Your PC's Specs, Model and Serial Number.
5. Run commands (Win+R) cheat sheet
Type these in Win + R to jump straight to the tool.
| Command | Opens |
|---|---|
msconfig | System Configuration (startup/boot/services) |
regedit | Registry Editor |
services.msc | Services |
gpedit.msc | Group Policy (Pro/Enterprise; Home has no such tool) |
devmgmt.msc | Device Manager |
diskmgmt.msc | Disk Management |
compmgmt.msc | Computer Management (bundles the above) |
eventvwr.msc | Event Viewer (great for troubleshooting) |
taskschd.msc | Task Scheduler |
perfmon.msc | Performance Monitor |
control | Control Panel |
appwiz.cpl | Programs and Features (uninstall) |
sysdm.cpl | System Properties (remote/performance/advanced) |
ncpa.cpl | Network Connections |
firewall.cpl | Windows Firewall |
desk.cpl | Display Settings |
main.cpl | Mouse Properties |
intl.cpl | Region and Language |
timedate.cpl | Date and Time |
powercfg.cpl | Power Options |
msinfo32 | System Information |
dxdiag | DirectX Diagnostics |
winver | Windows version number |
explorer | open File Explorer |
cmd / powershell | open the matching terminal |
ms-settings: | open Windows 11 Settings (add a suffix like ms-settings:network) |
shell:startup | current user startup folder (for auto-start) |
shell:sendto | right-click "Send to" menu |
%temp% | temp folder |
. | open the current user folder |
6. Common PowerShell (stronger than cmd)
Get-Process :: process list
Stop-Process -Name name -Force :: end a process
Get-AppxPackage :: list apps (pipe to uninstall)
Get-NetIPAddress :: see IP
Test-NetConnection domain :: connectivity test
winget list / install / upgrade :: manage software
Get-ChildItem :: list a directory (like dir)
7. Beginner pitfalls
- Paths with spaces need English quotes:
"C:\Program Files\App\app.exe". - Commands that change the system must run as administrator.
- Paste in the terminal with
Ctrl + Shift + Vor right-click. - Do not copy commands you do not understand, especially
format,del,rd /s /q, anddiskpart; they really do delete and format.
Wrap-up
For network issues start with ipconfig, ping, and flushdns; for system glitches use sfc and chkdsk; to jump to any tool, type its command from the table in Win + R. Keep this as a cheat sheet, and most "I can't find it in the UI" settings are one line away.