COM and Windows API result
0x80070005 E_ACCESSDENIED
Access was denied: Windows refused permission to a file, folder, registry key or service the operation needed. It is Win32 error 5 wrapped as an HRESULT.
Where you will see it
- Windows Update
- Installing or updating an app
- Microsoft Store
- Copying or deleting files
- Scheduled tasks and scripts
Likely causes, most common first
- The program is not running as administrator.
- Security software is blocking the change.
- Permissions on the folder or registry key were changed.
- A file is owned by another account or is in use.
How to fix it, in this order
Start with the first fix and check the result before moving on; each one says how to tell that it worked.
1. Run it as administrator (easy)
- Right-click the installer or program and choose Run as administrator.
- For a command, use Terminal (Admin).
It worked if: The step that failed now completes.
2. Pause third-party security software for one try (easy)
- Pause the antivirus or firewall from its tray icon.
- Try once more, then turn it back on.
It worked if: If it works with protection paused, add an exception in that product rather than leaving it off.
3. Run the Windows Update troubleshooter (easy)
- Open Settings, System, Troubleshoot, Other troubleshooters.
- Press Run next to Windows Update and apply what it suggests.
- Restart and check for updates again.
It worked if: Check for updates finishes without the error.
What Microsoft's documentation says
Microsoft's own wording for this code, quoted from the page named under each quote. The plain-English explanation and the fixes above are ours.
“General access denied error”
“Access is denied.”
“File system or registry key permissions have been changed and the servicing stack doesn't have the required level of access.”
Microsoft’s fix: open the newest CBS.log in %Windir%\Logs\CBS, find the “, error” line at the time of the failure, and correct the permissions on the file or registry key it names.
The same code, written other ways
Search a log or a forum for any of these; they are all this code.
- 0x80070005 (what Windows Update, DISM and installers print)
- -2147024891 (signed decimal, as PowerShell and some logs show it)
- 2147942405 (unsigned decimal)
- Windows error 5 (0x5), the number inside it; net helpmsg 5 prints its message
How the code is put together
Read from the bits as Microsoft's [MS-ERREF] Windows Error Codes specification lays them out.
- Severity: 1 (failure) (bit 31)
- Customer bit: 0 (Microsoft) (bit 29)
- NTSTATUS inside: 0 (bit 28)
- Facility: 7 (FACILITY_WIN32) (bits 16-26)
- Code: 5 (0x5) (bits 0-15)
Codes that often come with it
- 0x80070020 ERROR_SHARING_VIOLATION
The file is in use by another program, so it cannot be changed right now.
- 0x80004005 E_FAIL
Unspecified failure: the component that returned this did not say why.
More than one code in your log?
Paste the whole CBS, DISM or Windows Update log into the decoder. It lists every code in it, in order, with the line it was on. Decoded in your browser; nothing is sent.
Open the error code decoder →Helping someone with the same problem?
Send them this page, or link to it from a forum reply or your own site.