Nine built-in Windows commands — plus one memory diagnostic — fix most crashes, network failures, and slowdowns without reinstalling Windows. This guide runs them in the right order: update software first, repair the component store with DISM before running SFC, then check the disk, reset the network, kill frozen processes, and diagnose power drain. Every command includes what it fixes, the expected output, and when not to use it.
Is your PC constantly stuttering, throwing BSODs, dropping network connections, or crashing apps? Before you go down the nuclear path of a full system wipe, hang on — most of the time you don’t need anything that extreme. Windows ships with a set of built-in repair tools, and a few commands in an elevated Command Prompt fix most everyday problems. Below are the 9 CMD commands + 1 memory diagnostic, in the order you should run them. Start with the quick-reference table to jump straight to the one you need.
| Symptom | Run first | Note |
|---|---|---|
| Connected to Wi-Fi but pages won’t load | #5 ipconfig trio → #6 netsh trio | Light touch first |
| BSODs, app crashes, system file errors | #2 DISM → #3 SFC | Order matters |
| PC getting slower, long boot times | #1 winget, #4 chkdsk, #7 drive health | Update first, then check the disk |
| App frozen and won’t close | #8 taskkill | Don’t kill system processes |
| Laptop battery draining, waking at night | #9 powercfg | Check the battery report too |
Before You Start: 3 Things to Know
- All commands require an elevated Command Prompt (search for cmd, right-click, and choose Run as Administrator). Without elevation, many commands will fail with “Access is denied.”
- Back up your important files first. The commands themselves don’t touch your documents, but repairing system files and scanning disks is the kind of work you want a backup in place for.
- Go one step at a time. Run one command, read the result, then move on — and reboot between major repairs so the fixes take effect. Don’t paste all nine in at once.
The 9 Commands, in Order
The order below is deliberate. #1 is routine maintenance. #2 and #3 are a pair — DISM first, then SFC, never the other way around. #4 checks the disk, #5 and #6 fix the network, #7 checks drive health, #8 kills frozen processes, and #9 diagnoses power issues. Each entry follows the same pattern: scenario, command, expected output, and when not to use it.
1. Batch Update All Software: winget upgrade –all
Scenario: Many “Windows issues” are actually just legacy software acting up — an old driver or browser version that starts conflicting after a system update.
winget upgrade --all
What to expect: It automatically scans and updates all supported programs (browsers, drivers, utilities). Pro tip: run winget upgrade first to see the list, and only add --all once you’ve reviewed it. Make this a monthly habit to keep your system lean and stable.
When not to use it: Windows 11 ships with winget; Windows 10 needs App Installer from the Microsoft Store first. On a work PC with centrally managed software, check with IT before bulk-updating.
2. DISM: Repair the Component Store First
Scenario: When SFC can’t fix things, the problem is often not the system files themselves but the store SFC draws replacement files from — the component store. Fix the store first, then run SFC.
DISM /Online /Cleanup-Image /RestoreHealth
What to expect: It needs an internet connection and takes 15–30 minutes, so be patient. Want a quick check first? DISM /Online /Cleanup-Image /CheckHealth tells you in seconds whether the store has a problem.
Note: Reboot after DISM, then run SFC. The order is DISM → SFC — the other way around is wasted effort.
3. SFC Scan: Fix Corrupted System Files
Scenario: The classic signs of corrupted system files: features suddenly stop working, Settings won’t open, apps crash for no clear reason.
sfc /scannow
What to expect: It checks protected system files one by one and replaces damaged ones from cached copies. Read the last line: “did not find any integrity violations” means you’re clean; “repaired” means reboot and run it again to confirm; “could not perform the requested operation” means the component store is the problem — go back to #2.

When not to use it: If SFC stalls at a percentage for a long time (for example, 16%), don’t keep re-running it. See this walkthrough instead: Windows 11 Settings Crashing? Ultimate Fix for SFC 16% Hangs.
4. CHKDSK: Check and Repair Drive Errors
Scenario: Files won’t open, copies fail halfway, or a disk check keeps popping up at boot — usually a file system error or bad sectors.
chkdsk C: /r
What to expect: /r fixes file system errors and scans for bad sectors, attempting to recover data. Since the system drive is in use, it will ask whether to run at the next reboot — type Y and restart, and Windows will complete the scan before booting. (Replace C: with your drive letter if needed.)
When not to use it: /r includes /f. Use /r on spinning hard drives; SSDs don’t need bad-sector scanning (they manage bad blocks internally), so chkdsk C: /f is enough and much faster. A large drive can take hours with /r — don’t run it when you’re in a rush.
5. Network Troubleshooting Triad: ipconfig /flushdns + /release + /renew
Scenario: Wi-Fi shows connected, but pages won’t load and apps can’t reach the internet. Run these three first — they resolve the majority of “connected but no internet” issues.
ipconfig /flushdns
ipconfig /release
ipconfig /renew
What to expect: /flushdns clears the local DNS cache; /release + /renew drop the current IP address and request a fresh one from your router. Refresh a page afterward — in most cases it just works.
When not to use it: Disconnect from a corporate VPN first. On a machine with a static IP, /release drops connectivity until you re-enter the address manually.
6. Reset Network Stack: netsh Trio
Scenario: The triad didn’t help and the network problem is stubborn. Time for the heavy-duty reset: restore Winsock and the TCP/IP stack to factory defaults.
netsh winsock reset
netsh int ip reset
netsh int tcp reset
What to expect: Each command reports a reset success. You must reboot afterward — the reset doesn’t take effect until then.
When not to use it: These commands wipe manually configured IPs, DNS servers, and proxies — write them down first. VPN or proxy software may need to reconnect or reinstall its network component after the reboot.
7. Check Drive/SSD Health: Get-PhysicalDisk
Scenario: The PC keeps getting slower and files occasionally fail to open. Before deciding whether to repair or replace, check whether the drive itself is dying.
powershell "Get-PhysicalDisk | Format-Table FriendlyName, MediaType, HealthStatus, OperationalStatus"
What to expect: Look at the HealthStatus column: Healthy means all clear; Warning or Unhealthy means back up your data immediately and plan for a drive replacement. OperationalStatus shows whether the drive is online and working.
Note: This is a PowerShell command — wrapping it in powershell "..." lets you run it directly from CMD without opening a new window. It reads the drive’s SMART data, which beats guessing.
8. Force Kill Frozen Processes: tasklist + taskkill
Scenario: An app is frozen, the X button does nothing, and even Task Manager won’t open.
tasklist
List all running processes and find the PID (the number in the second column) of the frozen app.
taskkill /PID 1234 /F
Replace 1234 with the actual PID; /F forces termination. Easier still, kill by name and skip the PID lookup: taskkill /IM notepad.exe /F.
When not to use it: Never kill system processes (System, csrss, winlogon, svchost, and friends) — the wrong kill means a BSOD or a forced logoff. Only kill apps you recognize.
9. Power and Battery Diagnostics: powercfg /energy
Scenario: A laptop that drains battery abnormally, stays warm with the lid closed, or wakes itself in the middle of the night — usually a device waking the PC at random.
powercfg /energy
What to expect: It monitors the system for 60 seconds and generates an HTML report. The path shows up in the terminal (usually C:\Windows\System32\energy-report.html) — copy it into a browser to see which devices wake your PC, inefficient power policies, and the root causes of battery drain.
One more for laptops: powercfg /batteryreport generates battery-report.html in the current folder, with design capacity vs. full charge capacity and charge history — so you can spot a dying battery before it becomes a problem.
Bonus: Memory Diagnostic (The Ultimate BSOD Killer)
Scenario: Random BSODs with no pattern, crashes that no software fix can explain. Bad memory is a common culprit.
- Type
mdsched.exein the Start search bar. - Choose “Restart now and check for problems.”
- Windows will test your RAM during the next boot.
Where to see the result: You’ll get a notification after the reboot. If you miss it, open Event Viewer → Windows Logs → System and look for the entry with source MemoryDiagnostics-Results. If it reports errors, the RAM sticks need replacing — no software fix will help.
Bad memory can cause erratic crashes that no software fix can solve — if errors pop up here, you need to replace your RAM sticks.
Summary: Your One-Page Checklist
- Monthly:
winget upgrade --all. - Crashes / BSODs: DISM → SFC, reboot, then verify.
- No internet: ipconfig trio → netsh trio, reboot.
- Slow: chkdsk /f (SSD) or /r (HDD) → check drive health → back up and replace if unhealthy.
- Frozen app:
taskkill /IM name /F, never system processes. - Laptop battery drain:
powercfg /energy+/batteryreport. - Random BSODs: mdsched memory test.
- Still broken: hardware problem → replace the hardware; OS too damaged → Reset this PC (Settings → System → Recovery → Reset this PC, choose “Keep my files”).
Keep these commands in a note file and run through them periodically — most Windows problems never get as far as a reinstall.
FAQ
What if I get an “Access Denied” error?
You must run CMD as an Administrator: search for cmd, right-click, and choose Run as Administrator. SFC, DISM, and CHKDSK all require elevation — a normal Command Prompt can’t run them.
Are these commands safe for Windows 11?
Yes — they were verified against current Windows 11. Most also work on Windows 10, but winget needs Windows 10 1809 or later with App Installer installed.
What if SFC gets stuck at a percentage?
Don’t keep re-running it. If it stalls (for example, at 16%) for a long time, the component store is likely damaged — run DISM /Online /Cleanup-Image /RestoreHealth first, then SFC again. Full walkthrough: Windows 11 Settings Crashing? Ultimate Fix for SFC 16% Hangs.
What if nothing works?
Two cases: if drive or memory diagnostics report problems, it’s hardware — back up your data and replace the faulty part. If the hardware is healthy but Windows still misbehaves, reset Windows (Settings → System → Recovery → Reset this PC, choose “Keep my files”) — much less hassle than a full reinstall.
Related Reading
- Windows 11 Settings Crashing? Ultimate Fix for SFC 16% Hangs — a deep dive on SFC stalls and DISM error 1392, the advanced version of commands #2 and #3.
- Clean Up Windows Junk: 3 Secret Folders to Free Up GBs in 2 Minutes — once the commands are done, clear out the junk files; slowness often improves at the same time.
- Microsoft Support: Using System File Checker in Windows — the official SFC reference.