Introduction / Why This Is Needed
The DISM (Deployment Image Servicing and Management) tool is a built-in Windows command-line utility designed for servicing and repairing Windows images. Unlike sfc /scannow, which works with already loaded files in the C:\Windows\System32 folder, DISM operates on the Component Store (C:\Windows\WinSxS)—the source of reference system files.
If you encounter errors during Windows updates, system crashes, or if sfc /scannow fails to fix corruption, running DISM often resolves the problem at the root level. This guide will show you how to safely use DISM to analyze and restore your system's health.
Requirements / Preparation
Before you begin, ensure the following:
- Administrator privileges. All DISM commands require running as an administrator.
- Stable internet connection. When using the
/RestoreHealthparameter without specifying a source, DISM automatically downloads healthy files from Windows Update. If there is no internet, you will need to specify a local source manually (see step 4). - Sufficient free space on the system drive (at least 2-3 GB) for temporary recovery files.
- No active background update processes. It's best to perform this in "clean" mode or after a reboot.
Step-by-Step Instructions
Step 1: Open Command Prompt or PowerShell as Administrator
- Press the
Win + Xkey combination. - In the menu that appears, select "Windows PowerShell (Admin)" (in Windows 10/11) or "Command Prompt (Admin)".
- If a User Account Control (UAC) prompt appears, click "Yes".
In the opened window, you will see a command prompt, for example, C:\Windows\system32>.
Step 2: Perform a Primary Health Check of the Image
Enter the following command and press Enter:
dism /online /cleanup-image /checkhealth
/online— specifies that we are working with the currently running operating system./cleanup-image— the action to perform on the image./checkhealth— a quick check to see if a full scan is required.
What you will see: If everything is fine, after a few seconds you will see the message "The operation completed successfully" and "Image status: Healthy". If there are issues, it will indicate "Image status: Requires repair". This step does not fix errors, it only diagnoses.
Step 3: Run a Detailed Scan for Corruption (Optional, but Recommended)
For a full diagnosis, run:
dism /online /cleanup-image /scanhealth
This command deeply checks the Component Store (WinSxS) for inconsistencies and corrupted files. The process can take anywhere from 5 to 20 minutes.
Interpreting the result:
- "The operation completed successfully" — no corruption detected.
- "Image status: Healthy" — the image is intact.
- "Image status: Requires repair" — errors were found that need to be fixed in the next step.
Step 4: Repair the Corrupted System Image
This is the key step. Enter the command:
dism /online /cleanup-image /restorehealth
DISM will begin the repair process:
- Search for replacement files in the local store.
- If local files are insufficient, automatically connect to Windows Update to download them.
- Replace corrupted or missing components.
Important nuances:
- Execution time: 10 to 30 minutes. Do not interrupt the process.
- If DISM cannot find sources: You will receive an error like
0x800f081f. This means Windows Update is unavailable or the local store is too corrupted. In this case, specify a source manually. For example, if you have a Windows 10 ISO:
Wheredism /online /cleanup-image /restorehealth /source:WIM:X:\Sources\Install.wim:1 /limitaccessX:\is the drive letter of the mounted image, and:1is the image index in the WIM file (usually1for Windows 10/11). Use/limitaccessto prevent DISM from accessing Windows Update. - For Windows Server: You often need to specify a source as a path to the
sources\sxsfolder from the installation media.
Step 5: Re-check the Health Status After Repair
After step 4 completes, run the command from step 2 again:
dism /online /cleanup-image /checkhealth
Expected result: "Image status: Healthy". If the status is still "Requires repair", try:
- Run step 4 again (sometimes multiple attempts are needed).
- Specify an explicit source (see step 4).
- Run
dism /online /cleanup-image /startcomponentcleanup /resetbase(caution! this will delete old component versions to free space, but rollback will become impossible).
Step 6: Run System File Checker (SFC) to Finalize
After successfully repairing the DISM image, run the standard system file check:
sfc /scannow
Now sfc will be able to function correctly because the Component Store is fixed. After it completes (which can take 15-30 minutes), restart your computer.
Verifying the Result
- Primary indicator: Successful execution of
dism /checkhealthandsfc /scannowwithout error messages. - Practical test: Try to perform an action that previously caused problems (e.g., install a Windows update, launch a problematic application). The errors should be gone.
- Logs: For detailed analysis, check the DISM logs:
- Main log:
C:\Windows\Logs\DISM\dism.log - Log for
/RestoreHealth:C:\Windows\Logs\DISM\RestoreHealth.log
- Main log:
Potential Issues
Error 0x800f081f — "The source files could not be found"
Cause: DISM cannot find the necessary files for repair locally or via Windows Update. Solution:
- Ensure the computer is connected to the internet and can access
windowsupdate.microsoft.com(sometimes blocked by a firewall or proxy). - Specify an explicit source (see step 4). You will need installation media (ISO or DVD) of the same version and build of Windows as your installed system. Find your build number via
Win + R→winver. - If a source is specified but the error persists, the image on the media might be corrupted. Try downloading a fresh ISO from the official Microsoft website.
Access Denied or 0x80070005 Error
Cause: Command Prompt / PowerShell was not run as Administrator. Solution: Close the current window, open a new one strictly as Administrator (Win + X → the appropriate item).
Prolonged Hang at "Restoring" Stage
Cause: Network issues (slow or unstable connection when downloading files from Windows Update) or insufficient space on the C: drive.
Solution:
- Check free space on the system drive (at least 3-4 GB required).
- If the internet is slow, use a local source (step 4). This will significantly speed up the process.
- If it hangs for more than 1-2 hours, you can press
Ctrl + Cto cancel, then retry with a local source.
dism Command Not Found
Cause: You launched the wrong shell or the path to system folders is missing from the PATH variable.
Solution: Ensure you are in the standard Command Prompt or PowerShell (not third-party terminals). The best option is to use PowerShell as Administrator from the Win+X menu. If that doesn't work, navigate to the C:\Windows\System32 folder and run dism.exe from there.