Windows DISM Command Guide | Repair Windows Image

The Windows DISM command repairs the system image and component store to fix deep corruption that standard tools like SFC cannot resolve.

Windows usually runs smoothly, but system files sometimes break due to failed updates, sudden shutdowns, or malware. When the standard System File Checker (SFC) fails or freezes, the Deployment Image Servicing and Management (DISM) tool is your next line of defense. This utility lives inside Windows and fixes the hidden recovery image your computer uses to rebuild itself.

You do not need third-party software to run these repairs. You only need the Command Prompt and administrative privileges.

When To Run The DISM Tool

You should not run DISM as a daily maintenance routine. It connects to Windows Update to download fresh copies of broken files, so use it only when specific symptoms appear. If your system runs fine, leave these system files alone.

Run DISM if you see these signs:

  • SFC Fails — The command sfc /scannow returns an error stating “Windows Resource Protection found corrupt files but was unable to fix some of them.”
  • Windows Update Errors — Updates download but refuse to install, or the system rolls back changes after a restart.
  • System Instability — You experience unexplained Blue Screen of Death (BSOD) crashes or random application closures.
  • Feature Malfunction — Windows features like the search bar or Start menu stop responding.

How To Run Basic DISM Commands

The DISM tool has three main health-check stages: CheckHealth, ScanHealth, and RestoreHealth. You should generally run them in order. Each step requires you to open the Command Prompt as an administrator.

Open Command Prompt correctly:

  1. Press the Windows Key — Type “cmd” into the search bar.
  2. Select Run as Administrator — Right-click the Command Prompt result and choose the admin option to ensure the tool has permission to write system files.

CheckHealth: The Quick Scan

This command detects if a corruption marker already exists on the image. It does not perform a full scan; it simply reads the logs to see if Windows already knows something is wrong. It finishes almost instantly.

Type the following and press Enter:

DISM /Online /Cleanup-Image /CheckHealth

Interpret the results:

  • No component store corruption detected — The system has not flagged any issues yet. You should proceed to the next scan type to be sure.
  • Component store is repairable — Windows knows files are broken, and you can fix them.

ScanHealth: The Deep Analysis

If CheckHealth finds nothing, but you still have issues, use ScanHealth. This command checks the component store for corruption that hasn’t been logged yet. This process takes roughly 5 to 10 minutes depending on your drive speed.

Type this command:

DISM /Online /Cleanup-Image /ScanHealth

The progress bar might pause at 20% or 40%. This is normal behavior as the tool verifies large file chunks. Do not close the window.

RestoreHealth: The Repair Process

This is the command that actually fixes the problems. It connects to Windows Update to download healthy copies of damaged files.

Run this command:

DISM /Online /Cleanup-Image /RestoreHealth

Note during the process:

  • Internet connection required — The tool needs to fetch data from Microsoft servers.
  • Wait time — This scan takes longer than the others, often 10 to 20 minutes.
  • Post-repair action — Once the screen says “The restore operation completed successfully,” you must restart your computer to apply the changes.

After the restart, it is smart to run sfc /scannow one more time. Since DISM fixed the backup image, SFC should now be able to repair the live system files successfully.

Repairing Windows With DISM Offline Source

Sometimes the RestoreHealth command fails because Windows Update is broken or unreachable. When this happens, you typically see Error 0x800f081f (“The source files could not be found”).

To bypass this, you can point DISM to a specific “Source” — a clean Windows ISO file or a USB installation drive. This forces the tool to grab healthy files from that local source instead of the internet.

Step 1: Get A Valid ISO File

You need a Windows ISO that matches your current version (Windows 10 or 11). You can use the official Microsoft Media Creation Tool to download this file.

Mount the ISO:

  • Locate the file — Find the ISO you downloaded in File Explorer.
  • Double-click the ISO — Windows will “mount” it, treating it like a DVD inserted into the computer.
  • Check the drive letter — Note the letter assigned to this new drive (e.g., drive E: or F:).

Step 2: Identify The WIM File

Inside that mounted ISO, navigate to the sources folder. You are looking for a massive file named either install.wim or install.esd.

Check the file path:

  • Path structure — Usually E:\sources\install.wim.
  • Confirm format — Most official ISOs use .wim, but some compressed downloads use .esd. You must know which one you have.

Step 3: Run The Source Command

Go back to your Administrator Command Prompt. You will use the /Source flag to tell DISM where to look. Replace E: with your actual ISO drive letter.

For .wim files:

DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:E:\sources\install.wim:1 /LimitAccess

For .esd files:

DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:E:\sources\install.esd:1 /LimitAccess

Breakdown of the command:

  • /Source — Tells the tool to look at your ISO.
  • :1 — Tells the tool to look at the first edition in the ISO (usually Home or Pro).
  • /LimitAccess — Prevents the tool from trying to contact Windows Update, forcing it to use the ISO only.

Troubleshooting Common DISM Errors

Even this robust tool encounters roadblocks. Here is how to handle the most frequent error codes returned by the console.

Error 87: The Option Is Unknown

This almost always results from a typo or spacing error. The command line is strict about syntax.

Quick fix:

  • Check spaces — You must place a space before every forward slash.
  • Incorrect:DISM/Online/Cleanup-Image/CheckHealth
  • Correct:DISM /Online /Cleanup-Image /CheckHealth

Error 50: DISM Does Not Support Service Windows PE

This error suggests the tool thinks you are in the wrong environment or a registry key is misplaced.

Try these steps:

  1. Refresh the registry — Open Registry Editor and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control. Look for a folder named MiniNT. If it exists, right-click and delete it. Restart and try again.
  2. Check user account — Ensure you are definitely running CMD as Administrator. A standard user account cannot execute these service commands.

Error 0x800f081f: Source Files Could Not Be Found

As mentioned in the offline repair section, this means Windows Update cannot supply the files needed for the fix.

Your solution:

  • Use local source — Follow the “Repairing Windows With DISM Offline Source” instructions above.
  • Check firewall — Sometimes a strict network firewall blocks the tool from reaching Microsoft servers. Temporarily disable third-party antivirus software and retry.

DISM vs SFC: Understanding The Difference

Many users confuse these two utilities. While they work together, they perform distinct tasks.

SFC (System File Checker):

  • Target — Scans the active system files currently running Windows.
  • Source — Replaces bad files using the cached copies in the Component Store (a backup folder on your drive).
  • Use case — Run this first for minor glitches or errors.

DISM:

  • Target — Scans the Component Store itself (the backup folder).
  • Source — Downloads fresh files from Windows Update or external media.
  • Use case — Run this when SFC fails or cannot access the backup cache.

Think of SFC as repairing the walls of your house, while DISM repairs the supply truck that brings the bricks. If the truck is broken (Component Store corruption), the walls cannot be fixed.

Using PowerShell For DISM Commands

If you prefer PowerShell over Command Prompt, the syntax changes slightly. The underlying function remains the same, but the commands follow the Verb-Noun structure typical of PowerShell.

Basic Repair in PowerShell:

Repair-WindowsImage -Online -RestoreHealth

Check Health in PowerShell:

Get-WindowsImage -Online -CheckHealth

Some administrators prefer PowerShell because it provides clearer error logs in the console window. Just ensure you launch PowerShell with “Run as Administrator” privileges.

Analyzing The DISM Log File

When a command fails, the console usually points you to a log file located at C:\Windows\Logs\DISM\dism.log. This text file contains the technical details of every operation the tool performs.

How to read it:

  • Open in Notepad — Navigate to the folder and double-click the file.
  • Scroll to bottom — The most recent events are at the end of the file.
  • Search for “Error” — Press Ctrl+F and type “Error” or “Warning” to find the specific line where the process stopped.

This log is vital if you need to ask for help on tech forums. Experts can look at specific error codes in this log to tell exactly which driver or update package is causing the blockage.

Safe Mode Execution

If Windows cannot boot normally, you can run these commands from Safe Mode or the Recovery Environment (WinRE). This is often necessary when a bad driver prevents the desktop from loading.

Steps for recovery mode:

  1. Boot to WinRE — Interrupt the startup process 3 times or hold Shift while clicking Restart from the sign-in screen.
  2. Navigate menu — Choose Troubleshoot > Advanced Options > Command Prompt.
  3. Identify drives — In recovery mode, your C: drive might temporarily be labeled as D: or E:. Use the command dir c: or dir d: to find your Windows folder.
  4. Run command — Run the command normally, but if the drive letters changed, you might need to specify the image path manually (this is an advanced technique). Usually, the standard command works if you are just in Safe Mode with Networking.

Maintaining a healthy Windows installation requires minimal effort. By understanding how to leverage the DISM command, you can resolve complex update failures and corruption without resorting to a complete reinstallation of the operating system.