DISM - Fixing Component Store Corruption in Windows 8

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:



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.

Note   Note
The DISM /Cleanup-Image tool saves it's log files in the file locations below. To be able to view these logs, you would need to copy them from the locations below to your desktop, then open them from your desktop.

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

C:\Windows\Logs\DISM\dism.log


CBS.log.jpg

DISM.log.jpg

Tip   Tip
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   Note
Error: 0x80240021

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
Note   Note
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

CMD_CheckHealth.jpg



4. To Use DISM /ScanHealth Command
Note   Note
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

CMD_ScanHealth.jpg



5. To Use DISM /RestoreHealth Command
Note   Note
(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

CMD_RestoreHealth.jpg



6. To Use DISM /RestoreHealth /Source:wim Command
Note   Note
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.





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

DISM_RestoreHealth_wim_sources.png



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
Note   Note
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)

:arrow: Repair-WindowsImage /Cleanup-Image /CheckHealth

PowerShell_CheckHealth.jpg



4. To Use DISM /ScanHealth Command
Note   Note
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)

:arrow: Repair-WindowsImage /Cleanup-Image /ScanHealth

PowerShell_ScanHealth.jpg



5. To Use DISM /RestoreHealth Command
Note   Note
(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)

:arrow: Repair-WindowsImage /Cleanup-Image /RestoreHealth

PowerShell_RestoreHealth.jpg



6. To Use DISM /RestoreHealth /Source:wim Command
Note   Note
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.





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

PowerShell_DISM_RestoreHealth_wim_sources.png



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


 

Attachments

  • Command_Prompt.png
    Command_Prompt.png
    3.4 KB · Views: 629
Last edited by a moderator:
Hello consultantbis,

It can sometimes take a while (several hours) to finish. As long as you have hard drive activity, it would be best to let it sit until it's finished.
 
Hi, I was looking at the instructions and I only have a install.esd not the install.wim for this command Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /limitaccess
 
You should be able to use the command below instead with .esd instead. :)

Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.esd:1 /limitaccess
 
Thank you, now is there a need to right click and mount to run
Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:*C:\Users\Man\Desktop\Windows\sources\install.esd*:1 /limitaccess
it then changes the drive to F:DVD.
 
Yeah, you'll have to mount the ISO file to be able to access the .esd file. Be sure to change the drive letter in the command to whatever drive letter is assigned to the mounted ISO though.
 
I am trying to access the install.wim file from the original Windows 8.1 install disc using the dism command. I am getting source file not found error. Does it have to be a mounted .iso file drive? TIA!
 
Hello diverdown, and welcome to Eight Forums. :)

Using the disc is fine. You'll just need to make sure that you use the correct drive letter. In addition, check to see if it's install.wim or install.esd from the disc.
 
Thanks for the quick reply Brink. I must have other issues as I copied the install.wim to my c drive and still got the "source file could not be found" message. I even tried a complete reinstall from the original 8.1 disc and got the unable to install Windows 8.1 error "We couldn't install Windows 8.1. We've set your PC back to the way it was before you started installing" error code 0x101-0x20017 Funny thing is my machine is stable right now after spending a lot of time manually adjusting all of the issues. Shaking my head and moving on! Thanks again!
[h=1][/h]
 
You don't want to copy the file, but instead just use the path on the source installation disc.
 
No joy...still have windows source file not found with correct path to dvd drive D: I'm hosed with this setup. Been running 8.1 since it came out with no issues..until now. I guess I will bow to the MS gods and take my "free" Windows 10 upgrade! Thanks again for quick response.
 
It's been a while since I used this- I ran a virus scan on a laptop yesterday that removed the device's ability to connect to the Internet. The wifi works, but all I can get is a LAN connection. iPconfig crashes when I try to run it. I tried restoring the DLLs and now I'm running an SFC /scannow.

I want to run this but I'm not sure if it depends on a working internet connection.
 
Back
Top