How to Repair Corrupted Windows Files with SFC and DISM (Step by Step)

Last updated:
Med aissa
Written by:
Med aissa
made it 123

Table of Contents

     Crashes, update errors and strange behavior are sometimes caused by damaged Windows system files. Windows includes two built-in repair tools for this: DISM and SFC. Used together, they fix many problems without reinstalling Windows.

Quick answer

    Open Command Prompt as administrator and run DISM /Online /Cleanup-Image /RestoreHealth, then sfc /scannow. Restart afterwards.

What each tool does

  • DISM repairs the Windows component store, the source Windows uses to fix itself.
  • SFC scans protected system files and replaces damaged ones from that store.

Running DISM first gives SFC a healthy source to work from.

Step 1: Open an administrator Command Prompt

Click Start, type cmd, right-click Command Prompt, and choose Run as administrator. You can also use Terminal (Admin).

[Screenshot: Command Prompt opened as administrator]

Step 2: Run DISM

DISM /Online /Cleanup-Image /RestoreHealth

This can take 10 to 30 minutes and needs an internet connection. The progress bar may seem stuck at some percentage, which is normal. Don’t close the window.

Step 3: Run SFC

sfc /scannow

The scan also takes a while. Wait for it to reach 100%.

What the result means

  • “Windows Resource Protection did not find any integrity violations.” Your system files are fine, so the problem is elsewhere.
  • “Windows Resource Protection found corrupt files and successfully repaired them.” Restart your PC and test again.
  • “Windows Resource Protection found corrupt files but was unable to fix some of them.” Run DISM again, then SFC again. If it still fails, read the log (below).

Read the SFC log (optional)

To save the SFC entries to a file on your desktop, run:

findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfclogs.txt"

Open sfclogs.txt to see which files couldn’t be repaired.

If the problem remains

  • Run the tools in Safe Mode.
    Back up your files and use Settings → System → Recovery → Reset this PC, or repair Windows with the official installation media and the option to keep your files.
Med aissa
Author & Blogger

Author & Blogger at this site, dedicated to providing exclusive and useful content.

Comments