9 CMD Commands to Repair Windows

Last updated on August 4th, 2026 at 10:45 am

https://youtu.be/068WcwXQEGs?si=PCUVKyGlnYR8oIDS

Years ago, half my help desk tickets weren’t really hard. They were just slow.

A machine that wouldn’t update. A laptop crawling for no reason. Internet that dropped every ten minutes. The kind of thing a shop charges you $200 to “look at” — and then runs the exact commands I’m about to show you.

That’s the part nobody tells you. Most of what a repair tech does on a tired Windows machine is built into Windows already. Free. No download. No paid optimiser with a flashing “47 ERRORS FOUND” button.

I wish someone had handed me this list on my first day. It would’ve saved me a lot of late nights and a lot of driving. So here it is — nine commands, the order I actually run them in, and the honest version of what each one does. Stick around for the last one. It’s the one that’s saved me from blaming Windows for a problem Windows never caused.

One rule before we start: make a restore point first. Always. Couple of these touch the drive and the network stack, and you want a way back.

# Create a restore point before you run anything below
Checkpoint-Computer -Description "Before repair commands" -RestorePointType "MODIFY_SETTINGS"

Why the built-in commands beat the paid tools

Here’s the thing. The paid “PC repair” tools mostly wrap these same commands in a nice UI and charge you for it. Some of them do real damage — registry “cleaners” that delete keys nothing was hurting.

The built-ins are boring. They’re also what enterprise techs actually use on machines that matter. If a command is good enough for a domain-joined fleet, it’s good enough for your laptop.

You don’t need to memorise all nine. You need to know which one matches the symptom. That’s the whole skill.


The 9 commands (in the order I run them)

1. winget upgrade --all — update everything at once

Half the “slow PC” tickets I got were just out-of-date software. Old browser, old drivers wrapped in old apps, the lot.

winget upgrade
winget upgrade --all

Run the first to see what’s outdated, the second to update the whole lot. I used to update apps one by one while a client watched over my shoulder. This would’ve given me my afternoons back.

2. DISM /RestoreHealth — repair the Windows image FIRST

This is where most videos get it backwards. They run sfc first, it fails, and they’re stuck.

sfc repairs your system files by copying good ones from a local store. If that store itself is corrupt, sfc has nothing clean to copy from. So you fix the store first — with DISM — then run sfc.

DISM /Online /Cleanup-Image /RestoreHealth

Order matters. DISM, then SFC. Get that right and you’ll fix things the “just run sfc scannow” crowd can’t.

3. sfc /scannow — repair corrupt system files

Now that the store is healthy, this one actually works.

sfc /scannow

Weird crashes, missing system DLLs, a Settings panel that won’t open — this is the one. Back on the help desk this fixed more “haunted” machines than any reinstall.

4. chkdsk — check the drive

Random freezes and corrupted files are sometimes the drive crying for help.

chkdsk C: /scan
chkdsk C: /r

/scan runs live and read-only — start there. /r does a full repair and bad-sector check but needs a reboot, and on a big spinning disk it can take hours. Honest note: on an SSD, /r isn’t doing the bad-sector dance a hard drive needs — /scan is usually enough. Don’t fire /r at an SSD overnight expecting magic.

5. ipconfig — fix DNS and “internet’s down but Wi-Fi’s fine”

The classic. Connected to the router, no actual internet, or sites resolving to the wrong place.

ipconfig /flushdns
ipconfig /release
ipconfig /renew

Flush the DNS cache, drop the lease, grab a fresh one. I drove to sites for this exact problem before I trusted myself to talk a user through three lines.

6. netsh winsock reset — rebuild the network stack

When ipconfig doesn’t do it, the network sockets layer is corrupted — usually after a dodgy VPN or a half-removed antivirus.

netsh winsock reset
netsh int ip reset

Reboot after. This brings back machines that “have Wi-Fi” but can’t load a single page. Last network resort before you start blaming hardware.

7. Get-PhysicalDisk — check drive health before you panic

Before you tell anyone the drive is dying, check what the drive says about itself.

Get-PhysicalDisk | Format-Table FriendlyName, MediaType, HealthStatus, OperationalStatus

HealthStatus of Healthy means stop blaming the disk and look elsewhere. Anything else means back up now and order a replacement. This one line has stopped me throwing good money at a problem that wasn’t there.

8. tasklist / taskkill — kill what Task Manager won’t

Something’s pinning the CPU and Task Manager won’t close it.

tasklist
taskkill /IM rogueapp.exe /F
taskkill /PID 1234 /F

Find the process, kill it by name or PID. Faster than fighting a frozen GUI, and it works when the desktop itself is barely responding.

9. powercfg /energy — find what’s killing battery and sleep

Laptop that won’t sleep, drains overnight, or runs hot. Stop guessing.

powercfg /energy
powercfg /batteryreport /output "%USERPROFILE%\Desktop\battery.html"

/energy watches for 60 seconds and writes an HTML report of every driver and setting sabotaging your power. /batteryreport shows real-world wear vs. the original design capacity. I used to swap batteries on a hunch. This tells you if the battery’s actually cooked.


The last one — the command that saves you from blaming Windows

mdsched — Windows Memory Diagnostic.

mdsched

Here’s the bit I learned the hard way. I’d reinstall Windows on a machine that kept crashing, hand it back, and watch it crash again a week later. Reinstalled the OS. Twice. The problem was a faulty stick of RAM the whole time.

mdsched schedules a memory test on the next reboot. Random blue screens, crashes that follow no pattern, corruption that comes back no matter what you do — test the RAM before you nuke the OS. If I’d known this on day one I’d have saved two full rebuilds and a very awkward callback.

That’s the difference between guessing and diagnosing. And it’s the difference between a help desk tech who closes tickets and one who keeps reopening them.


The gotchas — the honest bit

  • DISM before SFC. Run them backwards and you’ll chase your tail. This trips up most tutorials.
  • chkdsk /r on an SSD is mostly wasted time. Use /scan. Bad-sector hunting is a spinning-disk thing.
  • Run an elevated prompt. Right-click, Run as administrator, or none of these touch the system files.
  • Restore point first. I said it up top. I’m saying it again.
  • These fix software. If the drive is physically failing or the RAM is dead, a command tells you that — it doesn’t bring hardware back from the grave. Knowing which problem you’ve got is the actual win.

Is it worth learning these?

If you’re trying to break into IT — yes, full stop. This is the exact muscle memory a help desk role runs on. Walk into an interview able to say “I’d run DISM then SFC, check the drive with chkdsk /scan, and rule out RAM with mdsched before I’d even talk about a reinstall” and you sound like someone who’s done the job. Because you will have.

The certs get you the interview. Knowing these cold gets you through the first week.

Save this page. You’ll need at least one of these within a month, and future-you will be glad it’s bookmarked.


What’s next

I’m planning a dedicated PowerShell companion video that goes deeper on the diagnostic side — Get-PhysicalDisk, event-log triage, and a couple of one-liners that replace half this list once you’re comfortable in a terminal.

Watch the full walkthrough on the channel, and if one of these saves your machine, tell me which one in the comments.

Tags: windows, troubleshooting, cmd, powershell, help desk, sysadmin, enterprise IT, breaking into IT

— Trev | I broke it. Fixed it.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top