Posts

Windows 10/11 Repair Commands Worth Knowing

When a Windows machine starts behaving unpredictably, it is tempting to jump straight to a major fix: prayers, reinstall Windows, replace hardware, or spend an afternoon chasing scattered advice across forums. Sometimes …

May 20, 2026 6 min read 1269 words

In this article

When a Windows machine starts behaving unpredictably, it is tempting to jump straight to a major fix: prayers, reinstall Windows, replace hardware, or spend an afternoon chasing scattered advice across forums.

Sometimes that level of repair is necessary. But often, the better first move is to check the system foundations.

Windows 10 and Windows 11 include several built-in command-line tools that can help diagnose and repair common system problems before you escalate to more invasive work.

These tools will not fix every problem. They are useful because they answer practical questions:

  • Are Windows system files intact?
  • Is the Windows component store healthy?
  • Does the disk have file system problems?
  • Is the machine throwing memory errors?

That foundation matters. A lot of strange Windows behavior comes down to file corruption, disk trouble, or memory instability.

Before You Start

Open Command Prompt or Windows Terminal as Administrator.

On Windows 10 or Windows 11:

  • Right-click the Start button
  • Choose Terminal (Admin) or Command Prompt (Admin)
  • Accept the UAC prompt

Save your work first. Some of these commands can take a while, and some may require a reboot.

The Short Version

If you just want the practical order, start here:

DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
chkdsk /f C:
mdsched.exe

That order is intentional.

DISM repairs the Windows image that SFC may rely on. Then SFC checks protected system files. Then CHKDSK checks the file system. Memory testing is useful when crashes, blue screens, or instability continue after the usual repairs.

Let’s walk through each one.

1. DISM: Repair the Windows Image

The Deployment Image Servicing and Management tool, usually shortened to DISM, checks and repairs the Windows component store.

In practical terms, Windows keeps a local source of system components that it can use to repair itself. If that source is damaged, other repair tools may be less effective.

Run this first:

DISM /Online /Cleanup-Image /RestoreHealth

What the switches mean:

  • /Online means you are repairing the currently running Windows installation.
  • /Cleanup-Image tells DISM you are working with the Windows image.
  • /RestoreHealth tells it to scan for corruption and repair what it can.

This command can pause at certain percentages for a while. Give it time to complete.

When it finishes, you want to see something like:

The restore operation completed successfully.
The operation completed successfully.

If DISM cannot find repair files, the machine may need access to Windows Update, installation media, or a known-good source image. At that point, the repair may require deeper troubleshooting.

2. SFC: Check Protected System Files

The System File Checker scans protected Windows system files and replaces bad versions with good ones when possible.

Run:

sfc /scannow

This is the classic Windows system file repair command.

Useful results include:

Windows Resource Protection did not find any integrity violations.

That means SFC did not find corrupted protected system files.

Or:

Windows Resource Protection found corrupt files and successfully repaired them.

That means it found problems and fixed them. Reboot afterward, then see if the original issue still exists.

A more serious result is:

Windows Resource Protection found corrupt files but was unable to fix some of them.

If you see that, run DISM again, then run sfc /scannow again. If it still fails, you may need to inspect the CBS log or move toward repair install territory.

The basic repair loop looks like this:

DISM repairs the repair source
        |
        v
SFC repairs protected system files
        |
        v
Reboot and test the original problem

This sequence is simple, but it is useful because it repairs the source first, then repairs the files that depend on it.

3. CHKDSK: Check the File System

CHKDSK checks a drive’s file system for errors. With the right flags, it can also fix what it finds.

For the main Windows drive, usually C:, run:

chkdsk /f C:

The /f flag tells Windows to fix file system errors.

If the drive is currently in use, which your C: drive almost certainly is, Windows will ask whether you want to schedule the check for the next reboot.

You will see something like:

Chkdsk cannot run because the volume is in use by another process.
Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)

Type:

Y

Then reboot when you are ready.

There is also a more aggressive option:

chkdsk /r C:

/r locates bad sectors and attempts to recover readable information. It implies /f, but it can take much longer, especially on large drives.

Use /r when you suspect physical disk problems, recurring corruption, or the drive is behaving suspiciously. If the drive is already showing SMART warnings or other signs of failure, back up important data first. Repair tools are not a substitute for a backup.

4. Windows Memory Diagnostic: Check RAM

Memory problems can create inconsistent failures that are hard to trace.

Bad RAM can look like:

  • Random blue screens
  • App crashes that do not point to one obvious app
  • File corruption
  • Installers failing for no clear reason
  • A machine that behaves differently from one reboot to the next

To launch Windows Memory Diagnostic from the command line:

mdsched.exe

Windows will ask whether you want to restart now and check for problems, or check the next time you restart.

Choose the option that fits your situation.

After the reboot, Windows will run the memory test before loading normally. When you get back into Windows, results may appear as a notification. If not, you can check them in Event Viewer:

  • Open Event Viewer
  • Go to Windows Logs > System
  • Look for events from MemoryDiagnostics-Results

If memory errors show up, take them seriously. Bad memory undermines trust in the rest of the system because it can corrupt data and cause failures that look unrelated.

A Practical Repair Flow

When a Windows machine is acting wrong, I do not start by assuming the most serious explanation. I start with the low-cost checks that reduce uncertainty.

Here is the order I would use for a normal repair pass:

  1. Back up anything important
  2. Run DISM /Online /Cleanup-Image /RestoreHealth
  3. Run sfc /scannow
  4. Reboot
  5. Run chkdsk /f C: if disk or file system trouble is suspected
  6. Run mdsched.exe if crashes or blue screens continue
  7. Review logs if the problem survives the first pass

You can also keep the core commands together in a little reference block:

# Repair the Windows component store
DISM /Online /Cleanup-Image /RestoreHealth

# Scan and repair protected system files
sfc /scannow

# Check and fix file system errors on C:
chkdsk /f C:

# Launch Windows Memory Diagnostic
mdsched.exe

What These Tools Will Not Fix

It is also important to know where these tools stop helping.

These tools are useful, but they do not fix everything.

They probably will not solve:

  • A failing SSD that needs replacement
  • Malware that is actively fighting the system
  • A broken third-party driver
  • A bad Windows update that needs rollback
  • A damaged user profile
  • Hardware overheating
  • Damage caused by unsafe cleanup or repair utilities

The point is not that DISM, SFC, CHKDSK, and mdsched.exe are universal repair buttons. The point is that they give you a clean baseline. They answer important questions before you start making bigger changes.

Final Thought

The best troubleshooting habit is not memorizing commands. It is reducing uncertainty in the right order.

Start with the foundation:

  • Repair the Windows image.
  • Repair system files.
  • Check the disk.
  • Check memory.

Then make your next decision based on what you actually found, not on guesses.

These tools are built into Windows 10 and Windows 11, they cost nothing, and they can save time when you need a clear first repair pass.

-Rob