Back to docs
Tools - DiagnosticsUpdated: November 23, 2024

dism /Online /Cleanup-Image /RestoreHealth

Scan and repair your Windows image using Windows Update.

dism /Online /Cleanup-Image /RestoreHealth

Command: dism /Online /Cleanup-Image /RestoreHealth

Category: Diagnostics

Type: CMD

Purpose

Uses the Deployment Image Servicing and Management (DISM) tool to scan the Windows component store for corruption and automatically repair it using Windows Update. This tool fixes system image problems that prevent System File Checker (SFC) from working correctly.

Quick Summary

DISM RestoreHealth is your heavy-duty system repair tool. When Windows is behaving strangely or SFC can't fix file corruption, DISM repairs the underlying component store that Windows uses to restore system files. Essential for fixing stubborn system corruption and preparing for successful SFC scans.

How to Use

  1. Open Command Prompt as Administrator.
  2. Type the full command: dism /Online /Cleanup-Image /RestoreHealth
  3. Press Enter and wait (this can take 10-30 minutes).
  4. The tool scans for corruption and downloads replacement files from Windows Update.
  5. Once complete, restart your computer.
  6. Follow up with sfc /scannow to repair system files.

Alternative syntax (shorter):

dism /online /cleanup-image /restorehealth

Important: Case doesn't matter, but spelling and spaces do.

Tips and Best Practices

  • Always run as Administrator - Required for system file access.
  • Be patient - The process can take 20-30 minutes; progress may appear stuck but is working.
  • Internet connection required - DISM downloads replacement files from Windows Update.
  • Run before SFC - If SFC reports unfixable errors, run DISM first, then SFC again.
  • Check progress - Look for progress percentage in the output; it updates periodically.
  • Don't interrupt - Stopping the process mid-repair could cause more corruption.
  • Restart after completion - Restart Windows to ensure repairs take effect.

Command Variations

Check for corruption without repairing:

dism /Online /Cleanup-Image /ScanHealth

Quick check (recommended first step):

dism /Online /Cleanup-Image /CheckHealth

Use local source files instead of Windows Update:

dism /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess

View DISM log file:

notepad C:\Windows\Logs\DISM\dism.log

Common Use Cases

  • System File Checker fails: Run DISM when SFC reports "Windows Resource Protection found corrupt files but was unable to fix some of them."
  • Windows Update issues: Fix corruption preventing updates from installing.
  • System instability: Repair corruption causing crashes, errors, or strange behavior.
  • Pre-upgrade preparation: Clean the system image before major Windows upgrades.
  • Store app problems: Fix issues with Windows Store apps not installing or launching.
  • .NET Framework problems: Repair Windows component store affecting .NET installations.

Prerequisites

  • Administrator rights (required)
  • Windows 8 or later (for RestoreHealth parameter)
  • Active internet connection (for downloading replacement files from Windows Update)
  • Adequate disk space (at least 10 GB free recommended)
  • Patience (process can take 20-30 minutes)

Understanding the Output

Progress indicators:

  • [====================100.0%====================] - Progress bar
  • The operation completed successfully. - No corruption found or repairs completed
  • The restore operation completed successfully. - Corruption was found and repaired

Common messages:

  • "No component store corruption detected" - System image is healthy
  • "The component store corruption was repaired" - Corruption found and fixed successfully
  • "The restore operation failed" - Check internet connection or try local source

Troubleshooting

  • "Error: 87" - Check command syntax; ensure correct spelling and spaces.
  • "Error: 3" - Run as Administrator.
  • Stuck at specific percentage - Be patient; it may appear frozen but is working. Wait at least 30 minutes.
  • "Error: 2" - Usually a syntax error; verify command spelling.
  • "Source files could not be found" - Internet connection problem; verify network connectivity and Windows Update service is running.
  • Fails repeatedly - Try using installation media as source: /Source:D:\sources\install.wim

DISM and SFC Relationship

Typical repair workflow:

  1. Run dism /online /cleanup-image /checkhealth (quick check)
  2. If issues found, run dism /online /cleanup-image /restorehealth (repair)
  3. After DISM completes successfully, run sfc /scannow (repair system files)
  4. Restart computer

Why this order?

  • DISM repairs the component store (repository of system files)
  • SFC uses the component store to repair actual system files
  • If component store is corrupt, SFC can't repair properly

Offline Repair (from Installation Media)

If Windows Update source doesn't work:

dism /Online /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /LimitAccess

Replace D: with your installation media drive letter.

  • sfc /scannow - System File Checker (run after DISM)
  • chkdsk /f - Check disk for file system errors
  • Windows Update - Keep system updated to prevent corruption
  • Get-WindowsImage (PowerShell) - Query Windows image information
  • Windows installation media - For offline repairs when needed