DISM (Deployment Imaging Service and Management) is a built-in Windows command-line tool that can repair the Windows component store—the hidden folder where system files, updates, and features are kept. When the component store is corrupted, Windows Update may fail, new features won’t install, and system files can’t be verified. Running DISM fixes the store itself, which then lets System File Checker (SFC) do its job properly. This guide walks you through the exact commands, what to do if they fail, and how to avoid common pitfalls.
What You’ll Need
- A PC running Windows 10 or Windows 11 (the steps work on both).
- Administrator access—you must be able to open Command Prompt as administrator.
- A stable internet connection (for the online repair option).
- About 15–30 minutes of time; the scan can take a while.
Step-by-Step
- Close all unnecessary programs. DISM is resource-intensive; closing other apps reduces the chance of interruptions.
- Open Command Prompt as administrator. Click the Start button, type
cmd, right-click “Command Prompt” in the results, and choose “Run as administrator.” If prompted by User Account Control, click “Yes.” - Check the health of the component store (optional but recommended). Type the following and press Enter:
DISM /Online /Cleanup-Image /CheckHealth
This is a quick check (usually under a minute) that reports whether the store is marked as healthy. It does not perform repairs. - Scan the component store for corruption. Type the following and press Enter:
DISM /Online /Cleanup-Image /ScanHealth
This scans the store for corruption. It can take 10–20 minutes. When it finishes, it will say whether corruption was found. - Repair the component store. Type the following and press Enter:
DISM /Online /Cleanup-Image /RestoreHealth
This uses Windows Update to download healthy files and replace corrupted ones. It can take 20–30 minutes or longer. Let it run to completion—do not close the window. - Reboot your PC. After the repair finishes (you’ll see “The restore operation completed successfully”), restart your computer.
- Run SFC (System File Checker) afterward. Open Command Prompt as administrator again, type
sfc /scannow, and press Enter. This verifies all system files and repairs any that are still corrupted. It’s a good follow-up because SFC relies on a healthy component store.
Common Mistakes
- Running DISM without administrator rights. If you don’t open Command Prompt as admin, you’ll get an “access denied” error.
- Skipping the reboot. Some repairs aren’t fully applied until you restart Windows.
- Interrupting the process. Closing the Command Prompt window or shutting down during a scan can leave the store in a worse state.
- Using the wrong command syntax. Typos like “/Online” vs “/Online” (with a space) are common. Copy-paste the commands from this guide to avoid mistakes.
- Running SFC before DISM. SFC may fail or report errors if the component store is corrupted. Always run DISM first.
Tips
- Use a log file to diagnose failures. If DISM fails, it creates a log at
C:\Windows\Logs\DISM\dism.log. You can open this in Notepad to see the exact error code. - If Windows Update is broken, use a local source. Instead of relying on Windows Update, you can point DISM to a mounted Windows ISO or a repair USB drive. The command becomes:
DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\path\to\install.wim /LimitAccess
Replace the path with the actual location of theinstall.wimorinstall.esdfile. - Run DISM in safe mode if normal mode fails. Booting into Safe Mode with Networking can bypass some third-party interference. To do this, hold Shift while clicking Restart, then go to Troubleshoot → Advanced Options → Startup Settings → Restart, and press 5 for Safe Mode with Networking.
- Be patient. The scan and restore can take a long time, especially on older hard drives. Don’t assume it’s frozen; watch the percentage progress.
Troubleshooting
If DISM doesn’t go as planned, here’s what to try:
- Error 0x800f081f or 0x800f0906: These usually mean DISM couldn’t find the source files online. Use the
/Sourceoption with a Windows ISO or repair media, as described in the Tips section. - Error 0x800f0954: This often happens when the Windows Update service is disabled or blocked. Make sure Windows Update is set to “Automatic” in Services (press Win+R, type
services.msc, find “Windows Update”, and set its Startup type to Automatic). Then try again. - DISM hangs at a certain percentage: Wait at least 30 minutes before giving up. If it’s truly stuck, close the window, restart the PC, and try the offline repair method using a Windows ISO.
- “The restore operation completed successfully” but problems persist: Run
sfc /scannowagain, then check Windows Update. If issues remain, consider using the “Reset this PC” feature (Settings → System → Recovery) as a last resort. - If you’re using Windows 11 and the command fails: The same commands work, but ensure you have the latest Windows 11 updates installed. Also, try running DISM from the Windows Recovery Environment (WinRE) if normal mode fails—boot from a recovery drive, open Command Prompt, and run the same commands but with
/Offlineand a path to the Windows partition.
Frequently Asked Questions
What exactly does DISM repair?
DISM repairs the Windows component store itself—the compressed repository of system files, updates, and features. If that store is corrupted, other tools like SFC can’t work correctly.
Is DISM safe to run?
Yes, DISM is a built-in Microsoft tool. It only replaces corrupted files with healthy ones from Windows Update or a local source. It won’t delete personal files.
How long does DISM take?
The health check takes under a minute. The scan can take 10–20 minutes. The restore can take 20–30 minutes or longer, depending on the amount of corruption and your hardware.
Do I need to run SFC after DISM?
Yes, it’s recommended. DISM fixes the component store, but SFC then repairs any system files that were already corrupted. Running SFC after DISM gives the best chance of a full repair.
Can I run DISM on Windows 7 or 8?
Yes, but the commands are slightly different. On Windows 7, you need to install the Windows AIK or ADK to get DISM. Windows 8 and later have DISM built in. This guide focuses on Windows 10 and 11.
What if DISM fails even with a local source?
If DISM still fails, your system may have deeper issues. Try using the “Reset this PC” feature (which reinstalls Windows while keeping your files) or perform a clean installation. Before that, check the dism.log for specific error codes and search for them online.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- USB-C vs Thunderbolt: Key Differences
- Enable Hidden Mac Features via Terminal
- Nvidia App GPU Tuning: Safe Manual Overclock
- 10 Tips for Fast Healthy Computer Performance
- Gmail Archive: What It Is and How to Use It
- How to Turn Off Background App Refresh on Apple Watch