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 > type cmd (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.

CommandOpens
msconfigSystem Configuration (startup/boot/services)
regeditRegistry Editor
services.mscServices
gpedit.mscGroup Policy (Pro/Enterprise; Home has no such tool)
devmgmt.mscDevice Manager
diskmgmt.mscDisk Management
compmgmt.mscComputer Management (bundles the above)
eventvwr.mscEvent Viewer (great for troubleshooting)
taskschd.mscTask Scheduler
perfmon.mscPerformance Monitor
controlControl Panel
appwiz.cplPrograms and Features (uninstall)
sysdm.cplSystem Properties (remote/performance/advanced)
ncpa.cplNetwork Connections
firewall.cplWindows Firewall
desk.cplDisplay Settings
main.cplMouse Properties
intl.cplRegion and Language
timedate.cplDate and Time
powercfg.cplPower Options
msinfo32System Information
dxdiagDirectX Diagnostics
winverWindows version number
exploreropen File Explorer
cmd / powershellopen the matching terminal
ms-settings:open Windows 11 Settings (add a suffix like ms-settings:network)
shell:startupcurrent user startup folder (for auto-start)
shell:sendtoright-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 + V or right-click.
  • Do not copy commands you do not understand, especially format, del, rd /s /q, and diskpart; 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.