The baseline: what a normal DISM repair looks like
Microsoft Support describes a simple two-step routine for Windows 10 and Windows 11:
- Open an elevated Command Prompt. Type
cmdin Search, right-click Command Prompt, choose Run as administrator and approve the UAC prompt. - Run:
DISM.exe /Online /Cleanup-Image /RestoreHealth - Once DISM reports success, run:
sfc /scannow
Microsoft's order matters. DISM supplies the files SFC uses for repairs, so DISM goes first. Microsoft also warns that RestoreHealth can take several minutes, and says not to close the window until SFC verification reaches 100%. Success looks like "The restore operation completed successfully" from DISM, followed by an SFC result saying no integrity violations were found or that corrupt files were repaired.
The /Online switch means "the copy of Windows that's running right now." It is the wrong switch for a Windows installation that won't boot. That point comes up again below.
Section summary: Run elevated, run DISM before SFC, and give it time. A slow progress bar alone doesn't mean DISM has failed.
Reading the error code before you start fixing things
Guiding Tech maps the common failures like this: 87 is a syntax problem, 5 or 740 means no admin rights, 0x800f081f, 0x800f0915 or 0x800f0906 mean DISM can't find or download repair files, and 50 means you tried /Online against Windows PE, for example from a recovery environment. That's a reasonable cheat sheet. Microsoft's documentation adds detail that changes what you should do next:
| Code | What Microsoft's documentation says | Practical takeaway |
|---|---|---|
| 0x800f081f | CBS_E_SOURCE_MISSING: the source for a package or file wasn't found | DISM couldn't find a good copy of a file. Give it a valid repair source (see below) |
| 0x800f0906 | CBS_E_DOWNLOAD_FAILURE: content download failed for Feature on Demand or inbox corruption repair | Check connectivity, proxy and repair-source access |
| 87 | Parameter not accepted in this scenario | Check typos first. Microsoft Learn also documents error 87 when an older DISM version is used against a newer Windows image |
| 0x80070005 / access denied | General access denied. File system or registry permissions may have changed | Elevation is the first check. If you're elevated and it still fails, read CBS.log |
| 5 / 740 / 50 | Guiding Tech's mappings, not separately confirmed in the Microsoft documents reviewed | Use them as hints, not diagnoses |
On error 87, the advice matches other guides. Windows Central notes that DISM commands are case-insensitive, but spaces must be exact. Commands copied from web pages can carry curly quotes, non-breaking spaces or long dashes in place of slashes. If a command looks right and still throws 87, type it by hand.
Fix 1: Check the syntax and the prompt
Guiding Tech's first step is also the cheapest. Open Command Prompt as administrator, type DISM /Online /Cleanup-Image /RestoreHealth manually, press Enter and leave the window open. Most "DISM is broken" reports end here, caused by a missing space or a non-elevated window.
Fix 2: Component store cleanup, used with care
The guide suggests running:
DISM /Online /Cleanup-Image /StartComponentCleanup
then RestoreHealth again, on the theory that leftover update files or pending operations are getting in the way. It's a fair thing to try. Microsoft documents StartComponentCleanup as removing superseded components and shrinking the component store, not as a required step before a repair. Two warnings deserve more attention than they usually get:
/ResetBasecan't be undone. Microsoft's command reference says installed Windows updates can't be uninstalled after StartComponentCleanup runs with/ResetBase. If a recent update is causing trouble, using/ResetBaseremoves your ability to roll it back./RevertPendingActionsis for recovery only. Guiding Tech correctly says not to use it as a routine fix. Microsoft is stricter: the option is only for system recovery on a Windows image that didn't boot, and it is not supported on a running OS, Windows PE or Windows RE image. In practice you run it from WinRE against the offline installation. Microsoft Learn givesdism /Image:C:\ /Cleanup-Image /RevertPendingActionsas the example.
The missing piece: pointing DISM at an ISO correctly
Guiding Tech's quick tips say to point DISM at "a mounted Windows ISO that matches your installed Windows version, edition, and language" when you hit 0x800f081f, but the guide doesn't give the command. This is the step where many people go wrong.
Microsoft Support documents the general pattern:
DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess
Replace C:\RepairSource\Windows with your real source. That can be a running Windows installation, a side-by-side folder, or the Windows folder of a mounted image. /LimitAccess stops DISM from contacting Windows Update. For servers, Microsoft Learn adds that a networked repair source machine must run the same operating system version.
A mounted ISO doesn't contain a ready-made Windows folder. It contains an install.wim or install.esd file that usually holds several editions, so DISM needs to know which edition to use. The syntax uses a Wim: prefix and the index of the edition inside the file. Here's the procedure:
- Download a Windows ISO that matches your installed version, then double-click it to mount it. Note the drive letter, for example
E:. - Look inside
E:\sourcesfor install.wim or install.esd. One guide notes that media built by the Media Creation Tool ships install.esd instead, and the same pattern works with an Esd: prefix. - List the editions in the file, for example
DISM /Get-ImageInfo /ImageFile:E:\sources\install.wim, and note the Index number whose Name matches the edition installed on the PC, such as Windows 11 Pro. - Run the repair with that index:
DISM /Online /Cleanup-Image /RestoreHealth /Source:Wim:E:\sources\install.wim:6 /LimitAccess
ReplaceEand6with your drive letter and index. UseEsd:andinstall.esdif that's what your media has.
Don't assume the index is 1. WOSHub found that on its media the Windows 11 Pro image in the install.wim file has ImageIndex = 6. If you point DISM at the Home edition index while running Pro, you've given it the wrong source, and 0x800f081f will probably come back.
Enterprise note: on managed PCs, the Group Policy setting Specify settings for optional component installation and component repair can redirect or block the repair source. If DISM ignores your source or fails to download on a domain-joined machine, ask your admin team before you start resetting things.
Fix 3: Resetting Windows Update components
DISM uses Windows Update as its default repair source, so Guiding Tech suggests a full component reset. It stops wuauserv, bits and cryptsvc, renames %systemroot%\SoftwareDistribution and %systemroot%\System32\catroot2 to .old, restarts the services, reboots and runs DISM again. It also suggests turning off any proxy under Settings > Network & internet > Proxy and briefly pausing third-party antivirus.
Treat this as a conditional fix, not a standard step. Microsoft's documentation reviewed here doesn't present the cache reset as a general cure for DISM failures. It makes the most sense when your error points to a download problem (0x800f0906) and the ISO-source method above isn't available. If you have a matching ISO, using it with /LimitAccess avoids the dependency on Windows Update altogether. If you pause your antivirus, turn it back on afterward.
Fix 4: CHKDSK, if you suspect the disk
The guide's fourth suggestion is chkdsk C: /f /r. Accept the offer to schedule it at the next restart, reboot, wait (it can take a long time on large or older drives) and then run DISM again. A failing disk can corrupt the files DISM is trying to repair, so this is a reasonable check if you see other signs of drive trouble. Nothing in Microsoft's guidance says an unexplained DISM stall means file system errors, though. It's a separate diagnostic step.
Read the log before you escalate
Microsoft Learn notes that DISM writes what it found and fixed to %windir%\Logs\CBS\CBS.log. The summary lists detected and repaired corruption counts and the final operation result. If DISM fails repeatedly, the log can name the exact payload that's missing, which tells you more than another reset will.
For SFC details, Microsoft Support gives this command to extract SFC entries to your desktop:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"
Fix 5: Repair-reinstall Windows without losing your stuff
If nothing else works, Guiding Tech recommends an in-place upgrade. Mount a matching Windows 11 ISO, run setup.exe, and at Ready to install make sure Keep personal files and apps is selected. Use Change what to keep if it isn't. Then click Install and let the PC restart as often as it needs.
The simpler route on Windows 11 is Settings > System > Recovery > Fix problems using Windows Update > Reinstall now. Microsoft says this reinstalls the current version and keeps your apps, files and settings. Keep the PC plugged in and connected to the internet throughout. Microsoft lists some limits:
- The option may be missing on versions older than Windows 11 with the 2022 annual update. You also need the February 2024 optional update or later.
- It isn't offered on managed devices, including those enrolled in Autopatch or with certain Windows Update policies set, such as WSUS server locations or deferral policies.
Microsoft also says to back up important files before any recovery operation. Don't confuse a repair reinstall with Reset this PC, which removes apps and settings.
The bottom line
Most DISM failures come down to three causes: the wrong prompt, the wrong syntax or the wrong source. Work through them in this order:
- Confirm the prompt is elevated, type the command by hand, and wait for it to finish.
- Note the exact error code.
- If the error is source-related, use a matching ISO with the correct
Wim:orEsd:index and/LimitAccess. - Check CBS.log.
- Only then try the bigger fixes: cache resets, disk checks and finally a repair reinstall.
When DISM succeeds, run sfc /scannow.
References
- Using DISM and SFC to Check and Repair Windows System Files woshub.com
- DISM Isn’t Working – Now What? Guiding Tech · 2026-10-16T01:30:00+00:00
- Fix Windows Update corruptions and installation failures - Windows Server | Microsoft Learn learn.microsoft.com