The stability of the Windows operating system relies entirely on a set of vital system files that manage application execution, update installations, and daily tasks. When these files are damaged or lost, users may experience unexpected behaviors such as system freezing, software errors, or the failure of core features. In cases where restarts or traditional troubleshooting are not enough, the Deployment Image Servicing and Management (DISM) tool stands out as an advanced technical solution to fix these issues.
What is the DISM tool and how does it work?
DISM is a command-line interface tool designed to scan Windows system images for damaged files and attempt to repair them. These commands can be run via Command Prompt or PowerShell, but it is essential to run the interface with Administrator privileges to make system-level changes. It is important to note that DISM focuses exclusively on system files, meaning your personal files and data remain completely safe during the repair process.
The three essential repair commands
All DISM commands follow a specific syntax starting with DISM /Online /Cleanup-Image, where the /Online option indicates working on the current Windows installation, while /Cleanup-Image performs recovery operations. This syntax branches into three main commands:
- CheckHealth command: This is the first and fastest step; it checks whether Windows has already logged damaged files and whether this damage is repairable.
- ScanHealth command: It performs a comprehensive, fresh scan of system files. It takes several minutes but provides an accurate report on the state of the "Component Store".
- RestoreHealth command: This is the most powerful command, as it scans the component store and automatically attempts to fix the damage. By default, this command relies on Windows Update to download the healthy files necessary for the repair process.
What to do if repair via Windows Update fails?
Sometimes, system file corruption can break the Windows Update service itself, preventing DISM from downloading alternative files. In this case, official Windows installation media (an ISO file) must be used as a repair source through the following steps:
- Download the Windows ISO file from the official Microsoft website and mount it so it appears as a virtual drive.
- Use the command DISM /Get-ImageInfo /ImageFile:D:sourcesinstall.wim (replacing D with the virtual drive letter) to find the Index number of your edition.
- Run the repair command while manually specifying the source using the following syntax:
DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:sourcesinstall.wim:6 /LimitAccess
(replacing D with the drive letter, and 6 with your edition's index number).
Why does this technical order matter?
Experts always recommend running the DISM tool before running the traditional System File Checker tool (SFC /scannow). The technical reason behind this is that the SFC tool relies on a healthy "Component Store" to replace damaged files. If the store itself is corrupted, SFC will not be able to repair the system. Therefore, repairing the store via DISM paves the way for SFC to work successfully.