Three DISM Commands for Repairing Damaged Windows System Images
Windows' built-in DISM tool can check and repair corrupted system files using three commands: CheckHealth, ScanHealth and RestoreHealth. If repair fails, official Windows installation media can serve as the source.

Users of Microsoft's Windows operating system whose computers have damaged or missing system files can turn to the built-in command-line tool Deployment Image Servicing and Management (DISM). It examines Windows system images and tries to fix corruption. Damaged files can cause error messages, freezes or features that stop working, and sometimes a restart or the usual troubleshooting steps are not enough.
DISM commands can be run in the command prompt or PowerShell, and both require administrator privileges. The tool deals only with system files, so personal files are left untouched.
The three commands
All three commands begin with DISM /Online /Cleanup-Image. The /Online option tells DISM to act on the Windows installation that is currently running, while /Cleanup-Image carries out recovery operations.
- /CheckHealth checks whether Windows has already flagged corrupt files and whether the damage can be repaired. It takes very little time, so it is recommended as the first step.
- /ScanHealth performs a fresh scan of system files and reports its findings. It can take several minutes.
- /RestoreHealth scans the component store, a protected repository of important system files, and tries to repair any corruption automatically. By default it fetches the files it needs from Windows Update.
If the repair fails
Damaged system files can also break Windows Update, leaving DISM unable to download replacements. In that case, an official Windows ISO from Microsoft's download page can be used. After it is downloaded and mounted as a virtual drive, the command DISM /Get-ImageInfo /ImageFile:D:sourcesinstall.wim lists the available Windows editions and their index numbers. RestoreHealth is then run with the /Source:WIM:D:sourcesinstall.wim:6 and /LimitAccess options, where D: is replaced with the drive letter of the mounted ISO and 6 with the index of the user's edition.
Once DISM finishes, the sfc /scannow command should be run. Microsoft recommends running DISM before System File Checker (SFC), because DISM repairs the component store that SFC relies on to replace corrupted files.


