---
title: "Repair Windows system files with SFC and DISM"
canonical: https://saasranked.com/guides/repair-system-files-sfc-dism/
applies_to: Windows 11, Windows 10
checked: 2026-10-02 (against Microsoft's documentation)
updated: 2026-10-02
---

# Repair Windows system files with SFC and DISM

- Microsoft says to run DISM before System File Checker, because DISM provides the files required to repair corrupted files [1].
- Dism /Online /Cleanup-Image /ScanHealth scans the image for component store corruption and takes several minutes [3].
- Dism /Online /Cleanup-Image /CheckHealth reports whether the image is healthy, repairable or non-repairable [2].
- If Windows Update is broken, add /Source and /LimitAccess so DISM repairs from a local Windows folder and doesn't contact Windows Update [1][3].
- SFC writes its details to %windir%\Logs\CBS\CBS.log, which you can filter into a text file on your desktop [1].

To repair Windows system files, open Command Prompt as administrator and run DISM.exe /Online /Cleanup-image /Restorehealth first [1]. DISM provides the files needed for the repair and uses Windows Update as its source [1]. Then run sfc /scannow, which scans all protected system files and replaces corrupted ones with a cached copy [1]. Keep the window open until the scan is 100% complete [1].

## Before you start

Missing or corrupted system files can make Windows features fail, cause system errors or make Windows freeze [1]. Windows has two built-in repair tools for this. DISM restores damaged Windows components, and System File Checker (SFC) scans for corrupted system files [1].

You need an administrator account, because both tools run in an elevated Command Prompt [1]. DISM uses Windows Update as its repair source, so stay online [1]. If Windows Update is broken, you can use a running Windows installation or a Windows side-by-side folder from a network share or removable media instead [1].

Each command can take several minutes [1]. Don't close the window until SFC reaches 100% [1].

## Steps

1. **Open an elevated Command Prompt.** Type cmd in the **Search** box. In the results, right-click **Command Prompt** and select **Run as administrator** [1]. If Windows asks for confirmation or an administrator password, type the password or click **Allow** [1].

2. **Check the image first (optional).** This scan looks for component store corruption and takes several minutes [2][3]:

    ```cmd
    Dism /Online /Cleanup-Image /ScanHealth
    ```

    Then run this command to see the result. DISM reports whether the image is healthy, repairable or non-repairable [2]:

    ```cmd
    Dism /Online /Cleanup-Image /CheckHealth
    ```

3. **Repair the image with DISM.** Type this command and press Enter. It may take several minutes [1]:

    ```cmd
    DISM.exe /Online /Cleanup-image /Restorehealth
    ```

    /RestoreHealth scans the image for component store corruption and then repairs it automatically [3].

4. **Use a repair source if Windows Update is broken.** Run this command instead of the one in step 3. Replace C:\RepairSource\Windows with the location of your repair source [1]:

    ```cmd
    DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess
    ```

    /LimitAccess stops DISM from contacting Windows Update [3]. If you give more than one /Source, DISM copies files from the first location where it finds them [2].

5. **Run System File Checker.** In the same window, type this command and press Enter [1]:

    ```cmd
    sfc /scannow
    ```

    SFC scans all protected system files and replaces corrupted files with a cached copy [1]. Don't close the window until the verification is 100% complete [1].

## Check it worked

When DISM succeeds, Command Prompt says "The restore operation completed successfully" or "The operation completed successfully" [4]. If you don't see a confirmation message, retype the command and try again [4].

SFC shows its result when the scan ends [1]:

- "Windows Resource Protection did not find any integrity violations." You don't have any missing or corrupted system files [1].
- "Windows Resource Protection found corrupt files and successfully repaired them." The repair worked [1].

To see what SFC found, copy its entries from the log to a text file on your desktop [1]:

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

The file holds details from every SFC run, so check the date and time of each entry [1].

## Common problems

- **"Windows Resource Protection could not perform the requested operation."** Run the SFC scan in safe mode [1]. To get there, open Windows RE and select **Troubleshoot** > **Advanced options** > **Startup Settings** > **Restart**, then pick **Enable Safe Mode** [5]. Also make sure the **PendingDeletes** and **PendingRenames** folders exist under **%WinDir%\WinSxS\Temp** [1].
- **"Windows Resource Protection found corrupt files but was unable to fix some of them."** Use sfcdetails.txt to find the file SFC couldn't repair [1]. Replace it with a known good copy, for example from another computer that runs the same version of Windows [1]. Microsoft's steps take ownership of the file, give administrators full access, then copy the good file over it [1]:

    ```cmd
    takeown /f <Path_And_File_Name>
    icacls <Path_And_File_Name> /grant administrators:F
    Copy <Source_File> <Destination>
    ```

- **DISM can't get repair files.** By default, DISM gets them from Windows Update [1]. Point it at a repair source with /Source and add /LimitAccess, as in step 4 [1][3].

## Questions

**Should I run SFC or DISM first?** DISM first. Microsoft says to run DISM before System File Checker, because DISM provides the files SFC needs to repair corrupted files [1].

**Does DISM need an internet connection?** By default, DISM uses Windows Update as the source of repair files [1]. With /Source and /LimitAccess, it uses a repair source you name and doesn't contact Windows Update [1][3].

**How long do the scans take?** Microsoft says the DISM repair may take several minutes [1]. Don't close the Command Prompt window until the SFC verification is 100% complete [1].

## Sources

1. [Use the System File Checker tool to repair missing or corrupted system files](https://support.microsoft.com/en-us/topic/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system-files-79aa86cb-ca52-166a-92a3-966e85d4094e), Microsoft Support, accessed 2026-10-02
2. [Repair a Windows Image](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/repair-a-windows-image), Microsoft Learn, accessed 2026-10-02
3. [DISM Operating System Package (.cab or .msu) Servicing Command-Line Options](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism-operating-system-package-servicing-command-line-options), Microsoft Learn, accessed 2026-10-02
4. [Troubleshoot problems updating Windows](https://support.microsoft.com/en-us/windows/troubleshoot-problems-updating-windows-188c2b0f-10a7-d72f-65b8-32d177eb136c), Microsoft Support, accessed 2026-10-02
5. [Windows startup settings](https://support.microsoft.com/en-us/windows/start-your-pc-in-safe-mode-in-windows-92c27cff-db89-8644-1ce4-b3e5e56fe234), Microsoft Support, accessed 2026-10-02

Checked against Microsoft's documentation on 2 Oct 2026.
