DISM (Deployment Image & Servicing Management) is a great tool from Microsoft. It works with your Windows images, Windows Setup, and Windows PE to repair them.DISM is a very useful command-line utility and can restore corrupted, damaged or modified system files. Running DISM Command Line can repair the System Image. Enable either Automatic or Manually.
Run the command DISM.exe /Online /Cleanup-image /Restorehealth to repair the system image. Enable the SFC utility to perform an integrity check on all protected system files, including those that Windows Resource Protection could not repair.
When Need to Run the DISM Command line?
When you start getting errors (especially after the Windows 10 Update 21H2) such as Blue Screen of Death (BSOD), application crashes, or certain system features stop working, this often indicates that there are missing/corrupt files or outdated drivers.
And We Recommend To Run A System File Checker Utility (sfc /scannow) To Scan And Restore missing corrupted system Files. The SFC utility if found any system file corruption or missing this will restore them from a special folder located on %WinDir%\System32\dllcache.
But there are times when you may notice missing files like in this example, but after following the steps of running a SFC /SCANNOW command, it returns no results found. Or if you see a “Windows Resource Protection found corrupt files but was unable to fix some of them…” error, it’s important for you to remember you have a safety net. You can use the Command Line DISM utility to repair your system image, and then have SFC scan your computer for damaged files.
Repair Windows System Image using DISM Command
Now that you know about the DISM command-line utility and what it does, let’s discuss the different options that can be used with it. We will discuss when it makes sense to use these options and how they work. I’ll also point out all the ones I think are most useful so don’t worry if you are short on time or aren’t going over all of them.
There are three main options available when DISM is used to repair the windows image, including CheckHealth, ScanHealth, and RestoreHealth.
DISM ScanHealth Command
DISM Command-line With /ScanHealth Switch checks for component store corruption and records that corruption to the C:\Windows\Logs\CBS\CBS.log but no corruption is fixed or repaired using this switch. This is useful for logging what, if any, corruption exists.
To Run, Open the Command prompt as administrator Then Type command Bellow and hit Enter key.
Dism /Online /Cleanup-Image /ScanHealth
This will start the scanning process for system image corruption. This could take up to fifteen minutes.
DISM CheckHealth Command
The /CheckHealth command is used to check whether a damaged image can be repaired. A corrupted image will not have data (simply put; incomplete or even corrupt) but with this command, one can determine what exact parts of the file are corrupted and whether it can be fixed by methods other than fixing it in disk images.
To run DISM CheckHealth command again, type the command below on an Admin Command Prompt and press Enter.
Dism /Online /Cleanup-Image /CheckHealth
Run DISM restore health Command
And the DISM command with the /RestoreHealth switch scans the Windows image for any corruption and performs repair automatically. This operation takes 15 mins or more depending on the level of corruption.
To run DISM restore health on administrator command prompt type command below and hit the enter key.
Dism /Online /Cleanup-Image /RestoreHealth
This command is used to repair damaged files on your Windows system. It may take some time but it will tell you when it is complete. If the problem is about corrupted Windows Update content, it might also be a good idea to restore the previous version of all files in case the newer versions just make things worse.
Run DISM with Source options
To run this System Image Manager with the source options, first download Windows 10 64-bit ISO or 32-bit from Microsoft. Your current version must match your version of Windows 10 that you downloaded.
After you complete download of the ISO file, right click on the file and select ‘Mount’. Note down the Drive Path location.
Now-Again open the Command Prompt and type the following command.
DISM /Online /Cleanup-Image /RestoreHealth /source:D:\Sources\Install.wim /LimitAccess
Note: Replace D with the letter drive on which your Windows 10 ISO is mounted
We’ll use Windows 10′s installation media to fix any mistakes that might have occurred while saving an image of a hard disk. This tool is ideal for those who wish to be sure their image backup isn’t compromised in any way.
Repair-WindowsImage is a PowerShell cmdlet used to attempt a repair of an installation of Windows from its image file (WIM) without attempting to use Windows Update as the source for files required for the repair.
Wait until 100% complete the Scanning Process. Once the process is completed, DISM will create an error log file in %windir%/Logs/CBS/CBS.log and notify you of any issues that it finds or fixes. After that, restart your computer to take Fresh Start.
Run System File Checker Utility
Now that you have completed the DISM tool ( Deployment Imaging & Servicing Management ) to repair files with corrupted or incorrect information on them, we hope they will change properly during the next time you run the sfc/scannow commands. A system file checker “utility” will check and update the damaged/missing files under Windows\System32 with a good copy stored in the \Operating System\System32\dllcache folder.
Restarting the computer usually acts as a fix to any sort of problems that come up during fixing or restoring system image and repair corrupted files Running DISM Command line tool.
If you ever come across any difficulty when following the steps above, or if you would like to see anything specific added please feel free to leave a comment below.