Fix error 0x80070005
0x80070005 is E_ACCESSDENIED, the Win32 code ERROR_ACCESS_DENIED. Windows Update could not open a file, folder or registry key it needs. Microsoft's first fix is to reset permissions on the WinSxS and SoftwareDistribution folders with icacls from an administrator Command Prompt, restart, and install the update again.
Checked November 10, 2026 against the manufacturer's own pages.
The short version
What to install and where it comes from. Every link goes to the manufacturer or Microsoft, never to a copy.
Official files only, nothing bundled
Step by step
Sign in with an administrator account
Access denied is sometimes just that: a standard account tried to install. Check Settings, Accounts, Your info. It should say Administrator under your name. If not, sign in with an admin account and retry from Settings, Windows Update.
Reset permissions on WinSxS and SoftwareDistribution
Search for cmd, right-click Command Prompt and pick Run as administrator. Run icacls "%windir%\WinSxS" /reset /t /c /q and then icacls "%windir%\SoftwareDistribution" /reset /t /c /q. Restart and try the update.
Give TrustedInstaller back ownership of WinSxS
If it still fails, run icacls "%windir%\WinSxS" /setowner "NT SERVICE\TrustedInstaller" /t /c /q in the same admin window. The servicing stack runs as TrustedInstaller, so it must own that folder. Restart again.
Rename the update cache folders
Stop the services with net stop wuauserv, net stop bits and net stop cryptSvc. Rename the folders with ren %windir%\SoftwareDistribution SoftwareDistribution.old and ren %windir%\System32\catroot2 catroot2.old. Start cryptSvc, bits and wuauserv again with net start.
Repair the component store, then system files
Run DISM /Online /Cleanup-Image /RestoreHealth, wait for it to reach 100%, then run sfc /scannow. DISM pulls clean copies from Windows Update by default, so stay online while it works.
Look for a third-party filter driver
Run fltmc to list file system filter drivers. Microsoft suggests temporarily turning off real-time protection in non-Microsoft antivirus and unloading its filter with fltmc unload followed by the driver name, then retrying the install.
Faster option: let a PC tool do the clean-up
The steps above fix this error. Errors like this often come back on a PC full of junk files, broken registry entries and leftovers from removed programs. A maintenance tool clears those in one scan.
Scan and clean up Windows
Finds junk files, invalid registry entries, startup slowdowns and privacy traces, then fixes them in one click.
Auslogics BoostSpeed 14 · Free version · Windows 11, 10, 8, 7 · 30-day refund on Pro
What 0x80070005 means during an update
The code is built from two parts. The 8007 prefix marks a Win32 error wrapped in an HRESULT, and 0005 is Win32 error 5, ERROR_ACCESS_DENIED. Microsoft’s Windows Update article names it E_ACCESSDENIED and lists five triggers: TrustedInstaller lost permissions on WinSxS or SoftwareDistribution, the Component Based Servicing registry key has wrong permissions, a security product locked update files, the SYSTEM account lost Full Control on the Windows folder, or a policy or management agent blocked writes to system folders.
Telling the causes apart
The CBS log is the quickest way to narrow it down. A line such as “Failed to create file” with E_ACCESSDENIED points to folder permissions, so the icacls reset is the right first move. A failure on “internally open package” points to the servicing store itself. If the error only appears on a work laptop, ask IT before changing anything, because a management policy may be the thing restricting access. On a home PC that has a second antivirus installed, the filter driver check is worth doing early.
A less common cause: access denied during a Windows upgrade
When the code arrives as 0x80070005 - 0x4000D, the failure happened in a feature upgrade, not a monthly update. Microsoft’s upgrade table places it in the second boot phase, while Setup migrates user data, and says access was denied to one data point. The fix is different here: read setupact.log and setuperr.log in a Panther folder (C:$Windows.~BT\Sources\Panther or C:\Windows\Panther) to find the file or profile that was blocked, then remove or repair it and run Setup again. Back up first, as Microsoft advises before any permission changes.
Questions
Is 0x80070005 a virus?
No. It is a permissions result code. Microsoft lists security tools that lock update files as one cause, but the code itself only says access was refused.
Where do I see which file was denied?
Open C:\Windows\Logs\CBS\CBS.log and search for 0x80070005 or E_ACCESSDENIED near the time of the failure. Running Get-WindowsUpdateLog in PowerShell writes a readable WindowsUpdate.log to your desktop too.
Will these commands delete my files?
No. They reset permissions on Windows system folders and rename the update cache so Windows downloads it again. Your documents, photos and apps stay where they are.
Should I take ownership of C:\Windows to fix it?
No. Microsoft's steps reset default permissions and set TrustedInstaller as the owner of WinSxS. Taking ownership yourself makes the problem worse.