Use DISM to Repair Windows 10 Image  

Page 1 of 83 1231151 ... LastLast
    Use DISM to Repair Windows 10 Image

    Use DISM to Repair Windows 10 Image

    How to Repair Windows 10 Image using DISM
    Published by Category: Performance & Maintenance
    12 Mar 2021
    Designer Media Ltd


    How to Repair Windows 10 Image using DISM


    If a Windows image becomes unserviceable, you can use the Deployment Imaging and Servicing Management (DISM) tool to update the files and correct the problem.

    For example, you would use DISM to fix Windows component store corruption when a sfc /scannow command is unable to repair corrupted or modified system files because the component store (source) is corrupted. SFC should be able to repair the files afterwards.

    For more information, see:

    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


    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 10.

    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.



    Contents

    • Option One: To Run "DISM /Cleanup-Image" Tool in Command Prompt
    • Option Two: To Run "DISM /Cleanup-Image" Tool in PowerShell






    OPTION ONE

    To Run "DISM /Cleanup-Image" Tool in Command Prompt


    1 Open an elevated command prompt.

    2 Do step3, step 4, step 5 (recommended), step 6, or step 7 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) Copy and paste the Dism /Online /Cleanup-Image /CheckHealth command into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

    Use DISM to Repair Windows 10 Image-dism_checkhealth.png


     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) Copy and paste the Dism /Online /Cleanup-Image /ScanHealth command into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

    Use DISM to Repair Windows 10 Image-dism_scanhealth.png


     5. To Use DISM /RestoreHealth Command

    (recommended) You would use /RestoreHealth to scan the image for component store corruption, perform repair operations automatically using Windows Update as the source, 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.

    You will need to have an Internet connection for this command to perform repair operations automatically using Windows Update as the source.

    If this command fails, then you can do step 6 or step 7 below instead.


    A) Copy and paste the Dism /Online /Cleanup-Image /RestoreHealth command into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

    Use DISM to Repair Windows 10 Image-dism_restorehealth.png


     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 10 ISO file.

    If you have an install.esd file instead of install.wim, then you would need to use step 7 below instead.

    If you get a 0xc1420127 or 50 error, see here.


    A) Use steps 1-4 in the tutorial below to verify if this Windows 10 ISO file has install.wim and what the index number is for your edition of Windows 10.
    B) Type the command below you want to use into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

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

    OR

    (To prevent DISM from using Windows Update for online images)
    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:Full Path to install.wim file:<Index Number> /limitaccess

    Substitute <Index Number> in the command above with the actual index number (ex: "1") for the edition (ex: "Pro") you want details about from step 6A above.

    For example: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /limitaccess


    Use DISM to Repair Windows 10 Image-dism_restorehealth_wim_sources.png


     7. To Use DISM /RestoreHealth /Source:esd Command

    You would use /Source with /RestoreHealth to specify the location of an install.esd 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.esd file will be in the Sources folder of a mounted Windows 10 ISO from Media Creation Tool (use ISO from OPTION ONE at link) file.

    If you have an install.wim file instead of install.esd, then you would need to use step 6 above instead.


    A) Use steps 1-4 in the tutorial below to verify if this Windows 10 ISO file has install.esd and what the index number is for your edition of Windows 10.
    B) Type the command below you want to use into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

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

    OR

    (To prevent DISM from using Windows Update for online images)
    Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:Full Path to install.esd file:<Index Number> /limitaccess

    Substitute <Index Number> in the command above with the actual index number (ex: "1") for the edition (ex: "Pro") you want details about from step 7A above.

    For example:

    Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:C:\$Windows.~BT\Sources\Install.esd:1 /limitaccess

    OR

    (USB from Media Creation Tool where E is drive letter of USB)
    Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:E:\Sources\Install.esd:1 /limitaccess


    Use DISM to Repair Windows 10 Image-dism_restorehealth_esd_sources.png

    8 If you did step 5, step 6, or step 7 above, it is recommended to restart the computer to fully apply.






    OPTION TWO

    To Run "DISM /Cleanup-Image" Tool in PowerShell


    1 Open an elevated PowerShell.

    2 Do step3, step 4, step 5 (recommended), step 6, or step 7 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) Copy and paste the Repair-WindowsImage -Online -CheckHealth command into the elevated PowerShell, press Enter, and go to step 8 below. (see screenshot below)

    Use DISM to Repair Windows 10 Image-powershell_repair-windowsimage_checkhealth.png


     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) Copy and paste the Repair-WindowsImage -Online -ScanHealth command into the elevated PowerShell, press Enter, and go to step 8 below. (see screenshot below)

    Use DISM to Repair Windows 10 Image-powershell_repair-windowsimage_scanhealth.png


     5. To Use DISM /RestoreHealth Command

    (recommended) You would use /RestoreHealth to scan the image for component store corruption, perform repair operations automatically using Windows Update as the source, 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.

    You will need to have an Internet connection for this command to perform repair operations automatically using Windows Update as the source..

    If this command fails, then you can do step 6 or step 7 below instead.


    A) Copy and paste the Repair-WindowsImage -Online -RestoreHealth command into the elevated PowerShell, press Enter, and go to step 8 below. (see screenshot below)

    Use DISM to Repair Windows 10 Image-powershell_repair-windowsimage_restorehealth.png


     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 10 ISO file.

    If you have an install.esd file instead of install.wim, then you would need to use step 7 below instead.

    If you get a 0xc1420127 or 50 error, see here.


    A) Use steps 1-4 in the tutorial below to verify if this Windows 10 ISO file has install.esd and what the index number is for your edition of Windows 10.
    B) Type the command below you want to use into the elevated PowerShell, press Enter, and go to step 8 below. (see screenshot below)

    Repair-WindowsImage -Online -RestoreHealth -Source "Full Path to install.wim file:<Index Number>"

    OR

    (To prevent DISM from using Windows Update for online images)
    Repair-WindowsImage -Online -RestoreHealth -Source "Full Path to install.wim file:<Index Number>" -LimitAccess

    Substitute <Index Number> in the command above with the actual index number (ex: "1") for the edition (ex: "Pro") you want details about from step 6A above.

    For example: Repair-WindowsImage -Online -RestoreHealth -Source "D:\sources\install.wim:1" -LimitAccess


     7. To Use DISM /RestoreHealth /Source:esd Command

    You would use /Source with /RestoreHealth to specify the location of an install.esd 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.esd file can be in the Sources folder of a mounted Windows 10 ISO from Media Creation Tool (Use ISO from OPTION ONE at link) file.

    If you have an install.wim file instead of install.esd, then you would need to use step 6 above instead.


    A) Type the command below you want to use into the elevated PowerShell, press Enter, and go to step 8 below. (see screenshot below)

    Repair-WindowsImage -Online -RestoreHealth -Source "Full Path to install.esd file:<Index Number>"

    OR

    (To prevent DISM from using Windows Update for online images)
    Repair-WindowsImage -Online -RestoreHealth -Source "Full Path to install.esd file:<Index Number>" -LimitAccess

    Substitute <Index Number> in the command above with the actual index number (ex: "1") for the edition (ex: "Pro") you want details about from step 7A above.

    For example: Repair-WindowsImage -Online -RestoreHealth -Source "C:\$Windows.~BT\Sources\Install.esd:1" -LimitAccess


    8 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




  1. Posts : 591
    Windows 10 Pro 64bit; Windows 10 TP; KDE Neon
       #1

    Hi

    I have an inquiry :

    If I wish "To Use DISM /RestoreHealth /Source:wim Command" (step 6) to restore the health of my 10240 installation, can I do this? Is it possible, I mean?

    And if I have the official 10162 ISO on my desktop, mounted so found on drive G: , which is the full path I should use?

    So, in my case the command is :
    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:G:\sources\install.wim:1 /limitaccess

    ?

    Because when I run it this way it says that it cannot find the Source..
      My Computers

  2. Brink's Avatar
    Posts : 59,912
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    Hello Joanne, :)

    You can use the command below from step 5 option one to do so unless DISM is unable to repair the Windows image from the default source.

    Dism /Online /Cleanup-Image /RestoreHealth


    Since it says it can't find the specified source using step 6, your ISO may have been created with .esd instead of .wim. If so, give step 7 a try to see it works.
      My Computers


  3. Posts : 591
    Windows 10 Pro 64bit; Windows 10 TP; KDE Neon
       #3

    Thank you for your reply! :)

    Here is the result. Please advise me what to do next to repair my installation. I have the official 10162 ISO on my other SSD.

    Use DISM to Repair Windows 10 Image-1.png

    Use DISM to Repair Windows 10 Image-2.png

    Here is the reason I am trying this. Look how many times today's update has failed installing....

    Use DISM to Repair Windows 10 Image-3.png
      My Computers

  4. Brink's Avatar
    Posts : 59,912
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Yep, in that case, use the command below to run the DISM command from the install.wim source on your G: drive. :)


    Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:G:\sources\install.wim:1 /limitaccess
      My Computers


  5. Posts : 591
    Windows 10 Pro 64bit; Windows 10 TP; KDE Neon
       #5

    I just did it but it cannot find the source files. I mounted the official 10162 ISO so the G:\ drive was created. Then I run the command. But it doesn't work.


    Use DISM to Repair Windows 10 Image-4.png


    Use DISM to Repair Windows 10 Image-5.png
      My Computers

  6. Brink's Avatar
    Posts : 59,912
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

    In that case, run the commands in the order below one at a time.

    Dism.exe /online /Cleanup-Image /StartComponentCleanup

    sfc /scannow

    Dism /Online /Cleanup-Image /RestoreHealth

    sfc /scannow
      My Computers



  7. Posts : 591
    Windows 10 Pro 64bit; Windows 10 TP; KDE Neon
       #7

    Okay... I've run the 3 out of the 4 commands and...I have issues as it seems....

    Use DISM to Repair Windows 10 Image-2.png


    So, what can I do next, please?

    Thank you.

    PS: how can I upload the CBS log file, in case it's needed?
      My Computers

  8. Brink's Avatar
    Posts : 59,912
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

    In that case, you may need to refresh Windows 10 instead.

    To upload the CBS.log, you would need to copy it to your desktop first, ZIP it, then upload the ZIP.
      My Computers


  9. Posts : 591
    Windows 10 Pro 64bit; Windows 10 TP; KDE Neon
       #9

    Brink said:
    In that case, you may need to refresh Windows 10 instead.

    To upload the CBS.log, you would need to copy it to your desktop first, ZIP it, then upload the ZIP.
    Thank you for your support, Brink!

    Please, allow me to ask you one simple question, before reading that entire tutorial :

    - I do not care at all what will happen with my Win 10 TP installation, I do not care wiping everything out of it - because I've not installed anything important- but what I DO care tremendously about is my Win 7 Home Premium installation, it being in a Dual boot system with 10, on this computer. So, I ask : this refreshing or whatever, can it affect my Win 7 in ANY way? Should I unplug my Win 7 SSD before attempting this refreshing?

    I would clean install this Win 10 for sure but it is this special occasion now. MS does not offer an official 10240 ISO. So clean-installing would bring me in waiting for 10240 again, etc etc...

    So?

    Oh! And one last thing... Until a couple of hours ago I was sitting with 10240 untouched, waiting to get updated. But I got bored so I performed a full Disk Cleanup, system files included, AND I have deleted all the files in the SoftwareDistribution/Downloads folder. Will this Refresh still work after all this?
      My Computers


 
Page 1 of 83 1231151 ... LastLast

Tutorial Categories

Use DISM to Repair Windows 10 Image Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 04:31.
Find Us




Windows 10 Forums