How to Repair Windows 10/11 System Files Using DISM and SFC

If the system files in your Windows 10/11 computer become corrupt and the System File Checker (SFC /scannow) is unable to reinstate the critical system files, it’s due to corruption of the Component Store located in the C:\Windows\WinSxS directory. This directory contains the files needed for the SFC utility to restore missing or damaged system files. The Component store stores all the Windows system files grouped by components and as hard links.

If the System File Checker is unable to repair/restore certain system files, it shows the following error:

sfc scannow cannot repair files

Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log.

A corrupted component store causes this error. There is a console tool named DISM (Deployment Image Servicing and Management) which ships with Windows. DISM is used to fix Windows Component Store corruption, especially when the System File Checker doesn’t help.

The DISM tool writes the following log files which help us analyze the operation status and errors:

  • C:\Windows\Logs\CBS\CBS.log
  • C:\Windows\Logs\DISM\DISM.log

This post tells you how to fix Windows 10 or Windows 11 if some system files or the component store are damaged.

Repair Windows 10 or 11 Using DISM and SFC

To repair Windows 10/11 using DISM and SFC, use the following steps:

Step 1: Repair the component store

If the checkhealth or scanhealth command-line reports of any corruption (and if it’s repairable), run the following command to repair the component store:

Dism /Online /Cleanup-Image /RestoreHealth

dism online restorehealth

When you run this command, DISM uses Windows Update to provide the files required to fix corruption. The command scans for component store corruption and does the repair operations automatically, writing the operational results to cbs.log and dism.log files. This process takes a long time to complete.

DISM RestoreHealth command fails to complete?

In some cases, the RestoreHealth command-line fails to run due to an unserviceable or corrupt image error (e.g., if your Windows Update client is already broken on the computer, DISM can’t fetch the missing files via the WU channel). Here are a couple of error codes that you may encounter:

Error: 14098 (0x80073712) ERROR_SXS_COMPONENT_STORE_CORRUPT
The component store is in an inconsistent state.
The component store has been corrupted.

Error: 0x800f081f
The source files could not be found.
Use the “Source” option to specify the location of the files that are required to restore the feature.

In those cases, you need to mention the WIM file as the source from which you can restore corrupted system files.

Follow the instructions in the article to run the RestoreHealth operation, mentioning the source location (slipstreamed Windows 10/11 disk). For more information, check out the article DISM Error 0x800f081f During RestoreHealth

You’d use this syntax in that case:

Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:Full Path to install.wim file:<Index>

Replace the <Index> placeholder in the above command with the actual index number for the Edition (“Home”, “Pro,” etc.) contained in the WIM file.

dism restorehealth completed successfully

For example:

Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\Sources\install.wim:1

You can list available editions and their indexes with the following command:

dism /get-wiminfo /wimfile:F:\sources\install.wim

(Replace the F:\sources\ portion with the actual path to your WIM file.)

find windows build version from iso file
Running DISM command on install.wim or install.esd

For more information, see the article Find the Windows version, build and edition from ISO or DVD

*Important*: Don’t use ESD!

If you have install.esd (instead of install.wim) in the Windows 10/11 setup disk, you must convert the ESD file into WIM for the above DISM command to work. In our tests, DISM was unable to use Install.esd as the source and the command ended up with the 0x800f081f error every time, regardless of the syntax (/source:wim:h:\sources\install.esd or /source:esd:h:\sources\install.esd) used.

dism restorehealth esd fails

The following command is absolutely useless. Don’t use it. It does nothing.

Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:"E:\Sources\Install.esd":1 /limitaccess

After converting the ESD file to WIM, I ran DISM mentioning the Install.wim file as the source. It ran perfectly fine, and it restored the missing manifest files indeed!

dism restorehealth wim success

Please keep this important point in mind when running DISM.

Step 2: Run the System File Checker

After you fix the component store corruption (if any) using the DISM tool, follow up with the System File Checker to restore the critical system files.

Run the following command from an elevated command prompt:

sfc /scannow

For more information, refer to Microsoft articles Use the System File Checker tool to repair missing or corrupted system files and Analyze the log file entries that SFC.exe generates


INFO: Checking for component store corruption without repairing it

DISM “CheckHealth” command:

The /CheckHealth is used to check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired. Note that this command doesn’t scan the files or fix anything; it only reports any corruptions marked already.



Open an elevated command prompt and type the following command, and press Enter:

Dism /Online /Cleanup-Image /CheckHealth

dism online checkhealth

DISM “ScanHealth” command:

To thoroughly scan (without repairing) the component store for corruption, then run DISM with the /ScanHealth parameter, as mentioned below, to check the component store for corruption. It scans for all files and verifies the hash values.

Dism /Online /Cleanup-Image /ScanHealth

dism online scanhealth

It takes a significantly more extended amount of time than the CheckHealth option, but using this switch may be doing a thorough test, and it also writes the results to the dism.log and CBS.log files.

The CBS.log file tells you if any manifests or files are missing from the component store.

Note:

  1. /Scanhealth checks for corruption but does not repair it.
  2. /RestoreHealth check s for corruption and attempts to repair it.

Thus, /Scanhealth is a subset of /RestoreHealth. There is no need to run both.

Difference between CheckHealth and ScanHealth

The CheckHealth command-line argument, as said earlier, reports if there is any corruption if already marked in the registry. It doesn’t scan the files. This parameter also reports if the component store corruption can be repaired or not.

If the following registry value is set, then the tool will report that the component store is corrupted:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing

DWORD Value name: Unserviceable
Data: 0 or 1

DWORD Value name: Corrupt
Data: 0 or 1

dism checkhealth scanhealth repair

If Unserviceable is set to 1, then running DISM with /checkhealth parameter would report The component store cannot be repaired.

dism checkhealth scanhealth repair

If Corrupt is set to 1 and Unserviceable is set to 0, DISM checkhealth would report The component store is repairable.

dism checkhealth scanhealth repair

The ScanHealth command-line, on the other hand, doesn’t rely on the previously marked data. It would rather scan each file in the WinSxS directory and sub-directories, verify their hashes. It then reports if the component store is corrupted or healthy.

dism checkhealth scanhealth repair

If the ScanHealth command-line finds the component store is healthy, it removes the corrupt and unserviceable values in the registry automatically, thereby marking the component store as healthy. The operations are logged on to the file dism.log.

Note: The DISM CheckHealth command-line was completed in less than 10 seconds. Whereas the ScanHealth command-line took 13 minutes to complete on my computer.

I hope that helps repair the component store and restore the Windows 10/11 system files.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

14 thoughts on “How to Repair Windows 10/11 System Files Using DISM and SFC”

  1. That solved my problem, thank you.

    Now I have a bilingual Start Menu: everything in Spanish, except “Administrative Tools” in English ;-). I’ve been unable to find the equivalent solution for Spanish-language installations… but it works!

    Reply
  2. Please ignore my previous comment, I am mow aware that it is unrelated to your post – I had several open pages and posted in the “wrong” one.

    However, I applied your recommendations and they worked. Thank you very much!

    Reply
  3. I am running Windows server 2019 with this error and I followed all of the above directions and got a clean bill of health on my system. The registry file was already in place and configured per your aid here. I still have the error code. Service unable to start due to missing file. Are there anymore ideas about this?

    Reply
  4. Thanks for your helpful page!

    I ran ScanHealth, which completed successfully with “The component store is repairable.”
    But when I ran RestoreHealth, it froze at 62.3%. It’s been frozen for over an hour. Can I stop it? If so, how? Or is there another solution to start it up again?

    Thank you in advance!

    Reply
    • @Val: If RestoreHealth stalls at 62.3%, it’s most likely because the Windows Update configuration in the computer is broken. Please ensure whether Windows Update is functioning correctly.

Leave a Comment