Three DISM commands for repairing Windows system images
Microsoft's Deployment Image Servicing and Management tool offers CheckHealth, ScanHealth and RestoreHealth commands to detect and repair corrupt Windows system files. RestoreHealth can use Windows Update or a mounted installation ISO as a repair source, and Microsoft recommends running DISM before sfc /scannow.

Main event
The article describes three DISM commands that administrators can use to check and repair damaged Windows system images: CheckHealth, ScanHealth and RestoreHealth. These commands are part of the Deployment Image Servicing and Management utility built into Windows.
What each command does
CheckHealth determines whether Windows has already flagged corrupt system files and whether the corruption is repairable. It completes quickly and is the recommended first step when investigating corrupt system files.
ScanHealth performs a fresh scan of system files and reports its findings. It may take several minutes to complete and provides a fresh report on the component store's health.
RestoreHealth scans the component store for corruption and attempts to repair it automatically. By default, it uses Windows Update to obtain the necessary system files.
Syntax and requirements
All three commands follow the syntax DISM /Online /Cleanup-Image, followed by the specific health option. The /Online option tells DISM to act on the currently running Windows installation, while /Cleanup-Image performs recovery operations on the selected installation. DISM commands require administrator privileges in either Command Prompt or PowerShell. DISM scans and repairs system files only; personal files remain untouched.
Using installation media as a repair source
If system file damage breaks Windows Update, DISM cannot download replacement files. In that case, an official Windows installation ISO from Microsoft's download page can supply the repair files. After mounting the ISO, administrators can run DISM /Get-ImageInfo /ImageFile:D:sourcesinstall.wim to list available Windows editions and their index numbers. The drive letter must match the mounted virtual drive.
The next step is DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:sourcesinstall.wim:6 /LimitAccess, replacing D: with the assigned drive letter and 6 with the index number for the installed Windows edition. This directs DISM to use the installation media instead of Windows Update.
Relationship with SFC
Microsoft recommends running DISM before sfc /scannow because DISM repairs the Windows component store, which System File Checker relies on to replace corrupted system files. After DISM completes, sfc /scannow can repair damaged or missing system files.
Context
The component store is a protected internal repository containing important system files that Windows requires to service, update and customize the operating system. Damaged or missing system files can cause system errors, unexpected behavior, freezes and features not working as expected. Restarting or usual troubleshooting steps may not be enough to restore them.




Comments
No replies yet. Start the discussion.
Sign in to reply