Skip to content

This guide isn’t available in Nederlands yet, so we’re showing the original English version.

Windows

How to Use Command Prompt to Scan for Corrupted System Files

Windows has two built-in repair tools. DISM fixes the Windows component store, and SFC (System File Checker) uses it to replace damaged system files. Run DISM first, then sfc /scannow, in an administrator Terminal.

Updated
Time
30 minutes
Difficulty
Medium
Applies to
Windows

By Published Oct 6, 2026

Quick answer

  1. 1 Right-click Start and open Terminal (Admin).
  2. 2 Run: DISM /Online /Cleanup-Image /RestoreHealth (takes 5–20 minutes).
  3. 3 Then run: sfc /scannow
  4. 4 Restart your PC when it finishes.
On this page
  1. Before you start
  2. Run DISM, then SFC
  3. Check the disk for errors too
  4. Troubleshooting
  5. Frequently asked questions

Before you start

  • Administrator access
  • An internet connection (for DISM)

Method 1 Run DISM, then SFC

  1. Step 1: Open an administrator Terminal

    Right-click Start and choose Terminal (Admin). Click Yes on the prompt.

  2. Step 2: Run DISM

    Paste the first command below and press Enter. It downloads clean copies of damaged components from Windows Update. The progress can pause at 20% or 62% for a while; that’s normal.

  3. Step 3: Run SFC

    When DISM finishes, run sfc /scannow. It checks every protected system file and replaces broken ones.

  4. Step 4: Restart

    Restart the PC, even if no problems were found.

Repair commands (run as administrator, in this order)
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
What the SFC result means
Message Meaning
Windows Resource Protection did not find any integrity violations All system files are fine
…found corrupt files and successfully repaired them Fixed; restart your PC
…found corrupt files but was unable to fix some of them Run DISM again, restart, then run sfc /scannow again
…could not perform the requested operation Run SFC from Safe Mode

Method 2 Check the disk for errors too

  1. Step 1: Schedule a disk check

    In the admin Terminal, run chkdsk C: /scan for a quick online scan, or chkdsk C: /f to fix errors at the next restart (type Y to confirm).

  2. Step 2: Restart

    For /f, restart and let the check complete. It can take a while on large hard disks.

Troubleshooting

DISM says “The source files could not be found”

Check your internet connection and Windows Update. Or mount a Windows ISO of the same version and use DISM /Online /Cleanup-Image /RestoreHealth /Source:X:\sources\install.wim /LimitAccess (replace X with the mounted drive).

SFC keeps finding the same problems

Try an in-place repair: run setup.exe from a Windows ISO and choose to keep files and apps. This reinstalls Windows without deleting anything.

Frequently asked questions

Is sfc /scannow safe?

Yes. It only replaces Microsoft system files with correct versions. Your personal files aren’t touched.

How long does it take?

DISM: 5–20 minutes. SFC: 5–15 minutes. Longer on hard disks.

Do I need to run it regularly?

No. Only when you have crashes, errors or features that stopped working.

Summary

Open Terminal (Admin), run DISM /Online /Cleanup-Image /RestoreHealth and then sfc /scannow, and restart. Add chkdsk if you suspect disk errors.

Sources

Written by

James Chambo

Founder

James is the Founder and Senior Editor of OnlineHow with more than 20 years of experience in internet publishing.