ThisCalculator

Everyday

How to Use DISM Commands: A Step-by-Step Guide

Updated · Standard formula, shown below

This guide explains how to use Deployment Imaging Service and Management (DISM) commands to repair Windows system images, prepare Windows images, and troubleshoot boot issues. You’ll learn the essential DISM commands, how to run them safely, and what to do when they fail.

What You’ll Need

  • A Windows 10 or Windows 11 PC (DISM is built-in, no download needed).
  • Administrator privileges (you must run Command Prompt as administrator).
  • An internet connection if you plan to use Windows Update as the repair source.
  • A Windows installation media (USB or ISO) if you need to repair the image offline.

Step-by-Step

  1. Open Command Prompt as Administrator. Click the Start button, type cmd, right-click on “Command Prompt”, and select “Run as administrator”. If prompted by User Account Control, click “Yes”.
  2. Check the health of the system image. Type the following command and press Enter:
    DISM /Online /Cleanup-Image /CheckHealth
    This command scans the image for corruption but does not fix anything. It’s a quick way to see if there are any known issues.
  3. Scan for corruption (detailed). Run:
    DISM /Online /Cleanup-Image /ScanHealth
    This performs a more thorough scan and can take 10-30 minutes. It checks the system image for any corruption that can be repaired.
  4. Repair the image. If the scan found issues, run:
    DISM /Online /Cleanup-Image /RestoreHealth
    This command repairs the image using Windows Update as the source. It can take 30 minutes or more. Make sure you have a stable internet connection.
  5. If RestoreHealth fails due to Windows Update issues, use a local source. Mount or insert your Windows installation media, note the drive letter (e.g., D:), and run:
    DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /LimitAccess
    Replace D: with your actual drive letter. The /LimitAccess flag prevents DISM from contacting Windows Update.
  6. After repairing, run System File Checker (SFC). Type sfc /scannow and press Enter. This will fix corrupted system files that DISM may have missed. It’s a good practice to run SFC after DISM repairs.
  7. Reboot your PC. Restart your computer to apply the repairs.

Common Mistakes

  • Running DISM without administrator privileges. You’ll get an “Access denied” error. Always right-click Command Prompt and select “Run as administrator”.
  • Using the wrong syntax. DISM commands are case-insensitive but must be typed exactly. A missing space or wrong slash can cause errors.
  • Interrupting the process. DISM can take a long time. If you close the Command Prompt or shut down your PC, the repair may be incomplete or cause further issues.
  • Using DISM on an offline image without specifying the correct path. If you’re repairing a Windows image file (like install.wim), you must use the /Image: parameter and point to the correct directory.
  • Not checking if the source is valid. If you use a local source, make sure the install.wim file is from a compatible Windows version. Using a mismatched version can cause errors.

Tips

  • Run CheckHealth first. It’s fast and can tell you if there are any known issues without a long scan.
  • Use ScanHealth to get a detailed report. It will tell you if corruption is found and whether it’s repairable.
  • Always run SFC after DISM. DISM fixes the system image, and SFC fixes individual system files. Running both ensures a thorough repair.
  • Create a system restore point before running DISM. If something goes wrong, you can revert to a previous state.
  • If you have a Windows installation media, use it as the source. This is often faster and more reliable than downloading from Windows Update.

Troubleshooting

Error 0x800f081f or 0x800f0906: These errors indicate that the source files cannot be found or are not accessible. Try using a local source with the /Source parameter. Make sure the path is correct and the install.wim file is present.

Error 0x800f0954: This often occurs when DISM cannot contact Windows Update. Use the /LimitAccess flag with a local source, or check your internet connection and firewall settings.

DISM hangs at 20% or 40%: This is normal. DISM can appear stuck for a while. Wait at least 30 minutes before assuming it’s frozen. If it’s been over an hour, you can press Ctrl+C to cancel, but this may leave the image in an inconsistent state. Try running the command again.

“The source files could not be found” even with a local source: Ensure the install.wim file is in the sources folder of your installation media. If you have an ISO, mount it (right-click > Mount) and use the drive letter that appears.

DISM says “The operation completed successfully” but SFC still finds errors: Run SFC again after a reboot. Sometimes SFC needs multiple passes to fix all corrupted files.

Frequently Asked Questions

What does DISM stand for?

DISM stands for Deployment Imaging Service and Management. It’s a command-line tool used to service and prepare Windows images.

Do I need to run DISM as administrator?

Yes, DISM requires elevated privileges. You must run Command Prompt as administrator, otherwise you’ll get an access denied error.

How long does DISM /RestoreHealth take?

It can take anywhere from 15 minutes to over an hour, depending on the speed of your PC and internet connection. It’s normal for it to appear stuck at a certain percentage.

Can I use DISM to repair a Windows image on another drive?

Yes, you can use DISM to repair an offline image. You need to use the /Image:C:\path\to\mount parameter and specify the location of the mounted or extracted image.

Is DISM safe to run?

Yes, DISM is a Microsoft-provided tool. Running the commands as described is safe and won’t harm your personal files. However, it’s always a good idea to back up important data before running any system repair tool.

What’s the difference between DISM and SFC?

SFC (System File Checker) scans and repairs individual system files. DISM repairs the underlying Windows system image. If SFC fails, running DISM first can fix the image so SFC can work properly.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.