How to Use DISM to Fix Component Store Corruption in Windows 8 and Windows Server 2012
One of the most used tools when fixing corruption for Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 was the System Update and Readiness Tool (KB947821), commonly called CheckSUR. The CheckSUR tool was an excellent way for most people to see what corruption had happened on their store, and potentially fix that corruption if the tool contained the payload to do so.
In Windows 8/8.1 and Windows Server 2012, this has changed. It’s called Inbox Corruption Repair and it brings the functionality of CheckSUR into Windows rather than requiring a separate download to get the utility like you do now. This is exposed in two ways, the first is really unseen by the end user and happens when Windows detects a corrupted state when attempting to install fixes via Windows Update. When this happens, Windows fix the corruption silently and then re-install the prior packages. The manual way to use this tool is via DISM (Deployment Imaging and Servicing Management). The way this is exposed is via the DISM /Cleanup-Image functionality.
If a Windows image (Windows component store) becomes unserviceable, you can use the Deployment Imaging and Servicing Management (DISM) tool to update the files and correct the problem.
For example:
- To use to fix Windows component store corruption when a SFC /SCANNOW command is unable to repair corrupted system files because the store (source) is corrupted, then run the SFC command again.
- To use to fix Windows component store corruption when the same Windows Updates continue to appear to be available to install even though they already show successfully installed in update history.
For more information, see:
- Fixing component store corruption in Windows 8 and Windows Server 2012 - The Windows Servicing Guy - Site Home - TechNet Blogs
- How to Repair a Windows Image
This tutorial will show you how to do an Inbox Corruption Repair with the DISM /Cleanup-Image tool to fix component store corruption in Windows 8 and Windows Server 2012.
You must be signed in as an administrator to be able to do an Inbox Corruption Repair with the Deployment Imaging and Servicing Management (DISM) tool.


If you get an error like below when running a DISM command in an option below, then run the command below and try again afterwards.
Dism.exe /online /Cleanup-Image /StartComponentCleanup
Note
Dism.exe /online /Cleanup-Image /StartComponentCleanup

Error: 0x80240021
Failure DISM. No operation was performed.
Failure DISM. No operation was performed.
CONTENTS:
- Option One: To Run "DISM /Cleanup-Image" tool in an Elevated Command Prompt
- Option Two: To Run "DISM /Cleanup-Image" tool in an Elevated PowerShell
OPTION ONE
To Run "DISM /Cleanup-Image" tool in an Elevated Command Prompt
1. Open an elevated command prompt.
2. Do step3, step 4, step 5, or step 6 below for what DISM command you would like to use.
3. To Use DISM /CheckHealth Command

You would use /CheckHealth to only check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired. This is just a quick way to see if corruption currently exists, and to inform you if there is corruption. This does not fix anything or create a log. This will finish running almost instantly.
A) In the elevated command prompt, copy and paste the command below, press Enter, and go to step 7 below. (see screenshot below)
:ar: Dism /Online /Cleanup-Image /CheckHealth

4. To Use DISM /ScanHealth Command

You would use /ScanHealth to scan the image for component store corruption. This option does not fix any corruption. It only checks for component store corruption and records that corruption to the log file. This can take around 5-10 minutes to finish. It will stay at 20% for a while before continuing.
A) In the elevated command prompt, copy and paste the command below, press Enter, and go to step 7 below. (see screenshot below)
:ar: Dism /Online /Cleanup-Image /ScanHealth

5. To Use DISM /RestoreHealth Command

(recommended) You would use /RestoreHealth to scan the image for component store corruption, perform repair operations automatically, and records that corruption to the log file. This can take around 10-15 minutes up to a few hours to finish depending on the level of corruption. It will stay at 20% for a while before continuing.
A) In the elevated command prompt, copy and paste the command below, press Enter, and go to step 7 below. (see screenshot below)
:ar: Dism /Online /Cleanup-Image /RestoreHealth

6. To Use DISM /RestoreHealth /Source:wim Command

You would use /Source with /RestoreHealth to specify the location of an install.wim file as the source of known good versions of files that can be used for the repair. This can take around 10-15 minutes up to a few hours to finish depending on the level of corruption. It will stay at 20% for a while before continuing.
This can be useful if step 5 above was not able to repair the Windows image (component store).
The install.wim file will be in the Sources folder of a mounted Windows 8.1 ISO file.
This can be useful if step 5 above was not able to repair the Windows image (component store).
The install.wim file will be in the Sources folder of a mounted Windows 8.1 ISO file.
A) In the elevated command prompt, type the command below you want to use, press Enter, and go to step 7 below. (see screenshot below)
:ar: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:Full Path to install.wim file:1
OR
(To prevent DISM from using Windows Update for online images)
:ar: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:Full Path to install.wim file:1 /limitaccess
For example:
:ar: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /limitaccess

7. If you did step 5 or step 6 above, it is recommended to restart the computer to fully apply.
OPTION TWO
To Run "DISM /Cleanup-Image" tool in an Elevated PowerShell
1. Open an elevated PowerShell.
2. Do step3, step 4, step 5, or step 6 below for what DISM command you would like to use.
3. To Use DISM /CheckHealth Command

You would use /CheckHealth to only check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired. This is just a quick way to see if corruption currently exists, and to inform you if there is corruption. This does not fix anything or create a log. This will finish running almost instantly.
A) In the elevated command prompt, copy and paste the command below, press Enter, and go to step 7 below. (see screenshot below)


4. To Use DISM /ScanHealth Command

You would use /ScanHealth to scan the image for component store corruption. This option does not fix any corruption. It only checks for component store corruption and records that corruption to the log file. This can take around 5-10 minutes to finish. It will stay at 20% for a while before continuing.
A) In the elevated command prompt, copy and paste the command below, press Enter, and go to step 7 below. (see screenshot below)


5. To Use DISM /RestoreHealth Command

(recommended) You would use /RestoreHealth to scan the image for component store corruption, perform repair operations automatically, and records that corruption to the log file. This can take around 10-15 minutes up to a few hours to finish depending on the level of corruption. It will stay at 20% for a while before continuing.
A) In the elevated command prompt, copy and paste the command below, press Enter, and go to step 7 below. (see screenshot below)


6. To Use DISM /RestoreHealth /Source:wim Command

You would use /Source with /RestoreHealth to specify the location of an install.wim file as the source of known good versions of files that can be used for the repair. This can take around 10-15 minutes up to a few hours to finish depending on the level of corruption. It will stay at 20% for a while before continuing.
This can be useful if step 5 above was not able to repair the Windows image (component store).
The install.wim file will be in the Sources folder of a mounted Windows 8.1 ISO file.
This can be useful if step 5 above was not able to repair the Windows image (component store).
The install.wim file will be in the Sources folder of a mounted Windows 8.1 ISO file.
A) In the elevated command prompt, type the command below you want to use, press Enter, and go to step 7 below. (see screenshot below)
:ar: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:Full Path to install.wim file:1
OR
(To prevent DISM from using Windows Update for online images)
:ar: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:Full Path to install.wim file:1 /limitaccess
For example:
:ar: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /limitaccess

7. If you did step 5, step 6, or step 7 above, it is recommended to restart the computer to fully apply.
That's it,
Shawn
Related Tutorials
- How to Run the "SFC /SCANNOW" Command at Boot or in Windows 8 and 8.1
- How to Do a Repair Install of Windows 8 and 8.1 without Losing Anything
- How to Reset Windows Update in Vista, Windows 7, and Windows 8
- How to Refresh Windows 8 and 8.1
- How to Reset Windows 8 and 8.1
- How to Do a System Restore in Windows 8 and 8.1
- How to Determine Size and if you should Clean Up Component Store (WinSxS folder) in Windows 8.1
- How to Clean Up the WinSxS Folder (Component Store) in Windows 8.1
Attachments
Last edited by a moderator: