DISM (Deployment Imaging Service and Management) is a built-in Windows tool that repairs system image corruption. When you run DISM /Online /Cleanup-Image /RestoreHealth and get error 0x80070005 (Access Denied), it usually means the command lacks the required permissions, or a system file is blocking access. This guide walks you through the fixes, from running DISM as an administrator to checking file permissions and using a Windows installation media as a repair source.
What You’ll Need
- A Windows PC (Windows 10 or 11) with administrative access.
- An internet connection (for the default Windows Update repair source).
- Optional: A Windows installation USB or DVD (if you need to use a local repair source).
- Optional: A blank USB drive (8 GB or larger) if you need to create installation media.
Step-by-Step
- Close all open programs and save your work. DISM can take several minutes, and a reboot may be needed.
- Open Command Prompt as Administrator. Click the Start button, type
cmd, right-click “Command Prompt” and select “Run as administrator”. If prompted by User Account Control, click “Yes”. - Check if DISM is already running. In the Command Prompt, type
tasklist | findstr /i "dism"and press Enter. If you see a DISM process, wait for it to finish or kill it withtaskkill /f /im dism.exe(only if you’re sure it’s stuck). - Run DISM with the exact command. Type the following and press Enter:
DISM /Online /Cleanup-Image /RestoreHealth
Wait for the process to complete. It may appear to hang at 20% or 40% – that’s normal. Do not close the window. - If the error persists, run SFC first. Type
sfc /scannowand press Enter. This checks system files. After it finishes, reboot and try DISM again. - Check the Windows Update service. Press
Win + R, typeservices.msc, and press Enter. Find “Windows Update”, right-click it, and select “Start” if it’s not running. Set its startup type to “Automatic” by right-clicking → Properties → Startup type → Automatic → Apply. - Use a local repair source (if Windows Update fails). Insert your Windows installation USB or DVD. Note the drive letter (e.g.,
E:). Then run:DISM /Online /Cleanup-Image /RestoreHealth /Source:E:\sources\install.wim /LimitAccess
If you have aninstall.esdinstead, use that path. If you don’t have installation media, skip to step 9. - If you don’t have media, create it. Go to Microsoft’s software download page, download the Media Creation Tool, and create a bootable USB. Then use the command from step 7.
- Check folder permissions. If you still get Access Denied, the problem might be with the
C:\Windows\Logs\DISMfolder. Open File Explorer, navigate toC:\Windows\Logs, right-click theDISMfolder → Properties → Security tab → Advanced. Click “Change” next to the owner, typeAdministrators, and click OK. Then check “Replace owner on subcontainers and objects”. Apply and restart. - Run DISM in Safe Mode. Restart your PC, press
Shiftwhile clicking “Restart” from the Start menu. Go to Troubleshoot → Advanced options → Startup Settings → Restart. Press4to enter Safe Mode. Then run the DISM command again.
Common Mistakes
- Not running as administrator. Even if your account is an admin, you must explicitly right-click and select “Run as administrator”.
- Typing the command with typos. The correct syntax is
DISM /Online /Cleanup-Image /RestoreHealth– note the spaces and slashes. - Interrupting the process. DISM can take 15-30 minutes. Closing the window or rebooting mid-way can cause errors.
- Using a corrupted install.wim. If your USB drive is damaged, the source will fail. Try a different USB port or recreate the media.
- Ignoring SFC. Sometimes SFC fixes files that DISM needs. Run SFC first if DISM fails.
Tips
- Always create a system restore point before running DISM. Type
rstruiin Run, or go to Control Panel → Recovery → Configure System Restore. - Use the
/LimitAccessswitch when using a local source to prevent DISM from trying Windows Update and failing. - Check the DISM log at
C:\Windows\Logs\DISM\dism.logfor more details. Look for lines with “Error” or “0x80070005”. - If you’re on a corporate PC, group policies might block Windows Update. Contact your IT admin.
- Keep Windows updated to avoid image corruption in the first place.
Troubleshooting
If DISM still fails with 0x80070005:
- Check if your antivirus is interfering. Temporarily disable third-party antivirus (not Windows Defender) and run DISM again. Re-enable it afterward.
- Verify that the Windows Modules Installer service is running. Open
services.msc, find “Windows Modules Installer”, and set its startup type to “Manual” (default) and start it. - Run a disk check. Type
chkdsk /f /rin an admin Command Prompt and restart. This will scan for disk errors that might cause access issues. - Use the Windows Update troubleshooter. Go to Settings → System → Troubleshoot → Other troubleshooters → Windows Update → Run. This can fix underlying update issues.
- If nothing works, try a repair install. Using the Media Creation Tool, choose “Upgrade this PC now” – this reinstalls Windows while keeping your files, but it’s a last resort.
Frequently Asked Questions
Why does DISM give Access Denied even when I’m an administrator?
Because the Command Prompt must be elevated. Right-click and select “Run as administrator”. If you’re still denied, your user account may not be in the Administrators group – check with your IT admin.
Can I run DISM from PowerShell instead?
Yes, but you still need to open PowerShell as administrator. The command is the same: DISM /Online /Cleanup-Image /RestoreHealth.
How long does DISM take?
Usually 15-30 minutes, but it can take longer on slow connections or older PCs. It may appear stuck at 20% – be patient.
Will DISM delete my personal files?
No. DISM only repairs Windows system files. Your documents, photos, and apps are untouched.
What if I don’t have a Windows installation USB?
You can create one using the Media Creation Tool from Microsoft’s website. Alternatively, you can use the /Source with a network share or a mounted ISO.
Is it safe to run DISM in Safe Mode?
Yes, it’s safe. Safe Mode loads minimal drivers and services, which can avoid interference. However, Windows Update may not work in Safe Mode, so use a local source.
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
- Fix Apps Not Downloading From Play Store
- Secure a Samsung Galaxy After a Zero-Day Disclosure
- What to Check Before Installing Linux Alongside Windows
- Fix OEM Activation Error 0xc004c060 in Windows 10
- Why Does My App Run One Query for the List and One per Item?
- Fix Google Chrome Has Stopped Working