If the system files in your Windows 10 computer become corrupt and the System File Checker (SFC /scannow
) is unable to reinstate the critical system files, it’s due to corruption of Component Store located at the C:\Windows\WinSxS
directory. This directory contains the files needed for 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.
This post tells you how to fix Windows 10 if some system files or the component store are damaged.
There is a console tool named DISM
which ships with Windows 10 by default. DISM is used to fix Windows Component Store corruption, especially in situations where the System File Checker doesn’t help.
The DISM tool writes the following log files which can be used to analyze the operation status and errors:
- C:\Windows\Logs\CBS\CBS.log
- C:\Windows\Logs\DISM\DISM.log
Repair Windows 10 Using DISM
To fix Windows 10 using DISM, use the following steps:
1. Open an elevated command prompt.
2. Type the following command and press ENTER:
1 |
Dism /Online /Cleanup-Image /CheckHealth |
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 fix anything, only reports the problems if any.
Alternately, you can use the /ScanHealth
command (below) to check for component store for corruption.
1 |
Dism /Online /Cleanup-Image /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 also writes the results to a log file.
To repair the component store, use the following command:
1 |
Dism /Online /Cleanup-Image /RestoreHealth |
The above command scans for component store corruption and does the repair operations automatically, writing the operational results to a log file. This process takes a long time to complete.
Additionally, you can mention the WIM file which can be used to restore corrupted system files. Use this syntax:
1 |
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.
For example:
1 |
Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\Sources\install.wim:1 |
You can list available editions and their indexes with the following command:
1 |
dism /get-wiminfo /wimfile:F:\sources\install.wim |
(Replace the F:\sources\ portion with the actual path to your WIM file.)
Follow up with the System File Checker to restore the critical system files, using the following command from an elevated command prompt:
1 |
sfc /scannow |
Hope that helps repair the component store and restore the Windows system files.