About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Windows Update error 0x80070005 means the update process was refused access to something it needs. Microsoft's page, "Troubleshoot Windows Update error 0x80070005" (page dated 2026-05-06), says the error "typically indicates a permissions problem" that affects the Windows component store, the Software Distribution folder, or related system resources.
The code is the Windows error ERROR_ACCESS_DENIED, number 5, "Access is denied." in Microsoft's system error codes list (page dated 2025-07-14).
What the error means
You install a Windows update, the installation fails, and error code 0x80070005 (E_ACCESSDENIED) is reported. The page says this occurs when the update process cannot access required files, folders or registry entries.
Three places matter: the component store (%windir%\WinSxS), the %windir%\SoftwareDistribution folder, and the registry subkey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing. %windir% is the Windows system folder, by default C:\Windows.
In the logs, the page says to look for entries that resemble these:
Error CBS Failed to create file. [HRESULT = 0x80070005 - E_ACCESSDENIED]
Error CBS Failed to internally open package. [HRESULT = 0x80070005 - E_ACCESSDENIED]
Likely causes
Microsoft's page lists five conditions. Any one of them produces the error.
| Cause (Microsoft's wording, shortened) | What it looks like | How to confirm |
|---|---|---|
The TrustedInstaller service account does not have permissions on %windir%\WinSxS or %windir%\SoftwareDistribution |
CBS.log lines such as "Failed to create file" with 0x80070005 | Read the permissions on both folders (next section) |
The permissions on the registry subkey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing are not correct |
The same CBS.log lines, with no obvious folder problem | Compare the key's permissions with a healthy computer of the same Windows version |
| A third-party antivirus or security tool locked update-related files or folders | The error stops when the tool's real-time protection is off | Step 6 below tests this directly |
The SYSTEM account does not have the Full Control permission on the %windir% folder |
Wide failures, not only updates | Read the permissions on %windir% |
| A Group Policy setting or a management agent restricted write access to system directories | Only managed computers fail; an unmanaged computer of the same build updates | Compare the failing computer's applied policies and agents with a computer that updates |
The "How to confirm" column is general advice; the page does not say how to test each cause.
Prove the cause before changing anything
These checks only read.
- Find the error in the logs. In CBS.log, look for the lines shown above. For the Windows Update log, Microsoft's page says to open a Windows PowerShell command prompt and run this cmdlet, then search the output for 0x80070005 entries:
Get-WindowsUpdateLog
The cmdlet's page says it merges Windows Update .etl trace files into one readable WindowsUpdate.log file. The "Windows Update log files" page (dated 2026-02-11) adds that the result is a static copy and does not update unless you run the cmdlet again.
- Read the owner and permissions of the two folders. The PowerShell cmdlet Get-Acl displays the owner of a resource and the access control entries in its discretionary access control list. Run it against the two folders from an elevated PowerShell window:
Get-Acl "C:\Windows\WinSxS" | Format-List Path, Owner, AccessToString
Get-Acl "C:\Windows\SoftwareDistribution" | Format-List Path, Owner, AccessToString
The page expects TrustedInstaller to have rights on both folders and to own WinSxS (its step 2). If the owner shown for WinSxS is someone else, or TrustedInstaller has no entry, you have found the first cause.
-
List the file system filter drivers by running
fltmcwith no arguments in an elevated command prompt; it only lists. -
Ask whether a management agent or Group Policy restricts the system folders. The page gives no command for this, so compare the failing computer with one of the same build that updates without the error.
-
Take the safety copy. The page's "Important" box says to back up the operating system disk before you troubleshoot. Do this before the Fix section.
Fix
Microsoft's page gives eight steps, each tried only if the update still does not install. After each of steps 1 to 5, restart the computer and try the update again.
Step 1: Reset the permissions on the component store
Save the current permissions first. The icacls page (dated 2025-06-09) says /save stores DACLs for matching files in a file for later use with /restore, with the pattern icacls c:\windows\* /save aclfile /t. In an elevated command prompt, use file names that do not exist yet (/save writes the file it is given) and are outside the two folders:
icacls "%windir%\WinSxS\*" /save "C:\acl-WinSxS.txt" /t
icacls "%windir%\SoftwareDistribution\*" /save "C:\acl-SoftwareDistribution.txt" /t
Then record the two folders' own owner and permissions in a new text file. Get-Acl is PowerShell, so run this in an elevated PowerShell window:
Get-Acl "C:\Windows\WinSxS" | Format-List Path, Owner, AccessToString | Out-File "C:\acl-folders.txt" -Append
Get-Acl "C:\Windows\SoftwareDistribution" | Format-List Path, Owner, AccessToString | Out-File "C:\acl-folders.txt" -Append
Reset the permissions
Risk: the reset commands below replace the access control lists on every file and folder under %windir%\WinSxS and %windir%\SoftwareDistribution with the default inherited ones; Microsoft's icacls page says /reset "Replaces ACLs with default inherited ACLs for all matching files". Custom permissions are lost unless you restore the saved file. That file covers what is inside the two folders, not the folders themselves, and holds DACLs only, not owners; the text record just taken is the only copy of the folders' own permissions and owner.
Back in the elevated command prompt, run Microsoft's reset commands, restart the computer and try the update again:
icacls "%windir%\WinSxS" /reset /t /c /q
icacls "%windir%\SoftwareDistribution" /reset /t /c /q
To undo it: restore the saved lists. The icacls page gives the form icacls c:\windows\ /restore aclfile, applied to the directory that holds the files. Each path below is quoted without a trailing backslash, which before a closing quote can read as an escaped quote (our note):
icacls "%windir%\WinSxS" /restore "C:\acl-WinSxS.txt" /c /q
icacls "%windir%\SoftwareDistribution" /restore "C:\acl-SoftwareDistribution.txt" /c /q
This does not restore the two folders' own permissions or any owner. Read those from C:\acl-folders.txt, set them back by hand, then compare with Get-Acl.
Step 2: Make sure that TrustedInstaller owns the WinSxS folder
Save the current owner first. In an elevated PowerShell window, run this and write down the Owner line:
Get-Acl "C:\Windows\WinSxS" | Format-List Path, Owner
Change the owner
Risk: the command below changes the owner of the %windir%\WinSxS folder and everything beneath it to the TrustedInstaller service account. Microsoft's icacls page says /setowner "Changes the owner of all matching files to the specified user". The step 1 ACL files do not keep owners, so the record taken here is the only copy of the folder's owner.
In the elevated command prompt, run Microsoft's command, restart the computer and try the update again:
icacls "%windir%\WinSxS" /setowner "NT SERVICE\TrustedInstaller" /t /c /q
To undo it: in the command prompt, set the owner back to the name you wrote down:
icacls "%windir%\WinSxS" /setowner "<PreviousOwner>" /t /c /q
One name restores a tree only if every item in it had that owner before.
Step 3: Reset Windows Update components
Disruptive step: the next commands stop the Windows Update, Background Intelligent Transfer and Cryptographic services, rename the SoftwareDistribution and catroot2 folders so that the original contents are no longer at their normal paths, and start the services again. Updates in progress on that computer will stop.
Microsoft's page gives these commands for an elevated command prompt:
net stop wuauserv
net stop bits
net stop cryptSvc
ren %windir%\SoftwareDistribution SoftwareDistribution.old
ren %windir%\System32\catroot2 catroot2.old
net start cryptSvc
net start bits
net start wuauserv
Restart the computer and try the update again.
To undo it: the .old folders still hold the original contents. Stop the services, rename the new folders aside, rename the .old folders back, and start the services:
net stop wuauserv
net stop bits
net stop cryptSvc
ren %windir%\SoftwareDistribution SoftwareDistribution.new
ren %windir%\System32\catroot2 catroot2.new
ren %windir%\SoftwareDistribution.old SoftwareDistribution
ren %windir%\System32\catroot2.old catroot2
net start cryptSvc
net start bits
net start wuauserv
If the first two ren lines fail because the folders were not recreated, skip them.
Step 4: Repair the component store
Risk: the next command repairs system files in the running Windows image, and by default DISM uses Windows Update as a repair source, so it needs the computer to reach Windows Update. The command changes the files it finds damaged, and there is no command to reverse it; the operating system disk backup you took before the Fix section is the way back.
Microsoft's page gives this command for an elevated command prompt:
DISM /Online /Cleanup-Image /RestoreHealth
Microsoft's "Repair a Windows Image" page (dated 2021-12-15) shows how to name another source with /Source. Restart the computer and try the update again.
Step 5: Check system file integrity
Risk: the next command checks the protected system files and, according to the page, may identify issues to repair. Repairs change system files, and the backup of the operating system disk is the way back.
Run Microsoft's command at an elevated command prompt:
sfc /scannow
If it identifies issues, the page points to its "Use the System File Checker tool to repair missing or corrupted system files" article. After the command finishes without errors, restart the computer and try the update again.
Step 6: Check for third-party interference
Disruptive step: the next steps turn off real-time antivirus protection and then unload a non-Microsoft file system filter driver. The computer is less protected while they are in place, and an unloaded filter driver does nothing until it is loaded again.
Microsoft's page gives these steps:
- Temporarily disable real-time antivirus protection on the affected computer.
- List the file system filter drivers:
fltmc
- If the list includes a non-Microsoft filter driver, temporarily unload it. In this command
<DriverName>is the name of the driver as thefltmccommand listed it:
fltmc unload <DriverName>
- Restart the computer and try the update again. If there is more than one non-Microsoft filter driver, repeat the unload for each of them and try again.
To undo it: turn real-time protection back on in the antivirus product. The page gives no command to reload an unloaded driver; as general advice, restart the computer and run fltmc again to see which filter drivers are loaded.
Step 7: Use the Azure VM Windows Update Reset Tool (Azure only)
Risk: the tool resets the Windows Update servicing stack on the virtual machine. Microsoft's page does not list what it changes and gives no way to undo it, so there is no back-out here; the operating system disk backup is the only way back, and it must exist before you run the tool.
Microsoft's page says to try the Azure VM Windows Update Reset Tool if the steps above do not fix an Azure virtual machine. You run it from the VM's page in the Azure portal using Operations > Run command, without signing in to the VM. The page says it clears memory-related lock states in the update agent. Try the update again afterwards.
Step 8: Use a repair VM (Azure only)
Disruptive step: this moves the affected operating system disk to a repair VM and back, and repeats the icacls, DISM and filter driver commands against the attached disk. The risks of steps 1, 2, 4 and 6 apply to each repeated command, and the permission and owner records from steps 1 and 2 cover only the original paths. Microsoft's page gives no back-out for the disk move or the repairs; the operating system disk backup is the way back.
If the reset tool does not fix it, or the VM cannot start, Microsoft's page describes creating a repair VM with the Azure VM repair commands, attaching the affected disk, repeating those commands against it, and reattaching the repaired disk to the original VM. If the update still does not install, the page's last instruction is to contact Microsoft Support.
Confirm the fix
- Run the update again; confirm it installs.
- Search CBS.log for new "0x80070005" lines dated after the install; old lines stay, so compare timestamps.
- Run Get-WindowsUpdateLog again and search the new copy; an earlier copy still shows the old failures.
- Run the Get-Acl commands again and confirm the owner and permissions are what you intended.
What to watch afterwards
- The next cumulative update. A reset permission fault can return if the same security tool, management agent or Group Policy setting changes the folders again; Microsoft's page lists those as causes.
- Security tools. If step 6 changed the result, ask the product's vendor about exclusions.
Read next
Related articles you may want next.
- TroubleshootingWindows Update error 0x80070422: the Windows Update service is disabled or not runningWindows Update error 0x80070422 means the Windows Update service stopped or is disabled. Read its start type, then fix it with a way back.Read article
- TroubleshootingWindows Server update fails with 0x800F0922 (CBS_E_INSTALLERS_FAILED): the corrupted SecureBootEncodeUEFI taskWindows Server update fails with 0x800F0922 (CBS_E_INSTALLERS_FAILED). Confirm the corrupted SecureBootEncodeUEFI task in the logs, back up, then fix.Read article
- TroubleshootingGroup Policy Preferences scheduled task not applying: event 4098 "did not apply because it failed with error code" 0x80070005 Access is deniedA user GPP scheduled task fails with event 4098 and 0x80070005. Read the event, then clear the logged-on user's security context option.Read article
Risks and limits
- The saved ACL files keep DACLs only. They do not restore owners, or the permissions of the two folders themselves; those go back by hand from the text record.
- Steps 4, 5, 7 and 8 have no back-out other than the disk backup. The ACL save and restore commands follow the icacls page's example and have not been run on a test computer.
- These steps were researched from Microsoft's pages and have not been lab-tested.
Sources
- Troubleshoot Windows Update error 0x80070005 — Microsoft Learn, page dated 2026-05-06, accessed 2 December 2026
- icacls — Microsoft Learn, page dated 2025-06-09, accessed 2 December 2026
- Get-WindowsUpdateLog — Microsoft Learn, no update date shown, accessed 2 December 2026
- Windows Update log files — Microsoft Learn, page dated 2026-02-11, accessed 2 December 2026
- Get-Acl — Microsoft Learn, no update date shown, accessed 2 December 2026
- Repair a Windows Image — Microsoft Learn, page dated 2021-12-15, accessed 2 December 2026
- ren — Microsoft Learn, page dated 2024-11-01, accessed 2 December 2026
- System Error Codes (0-499) — Microsoft Learn, page dated 2025-07-14, accessed 2 December 2026
This article was originally published on .