How to Fix Windows Update Error 0x80070005 [Fix]

Windows Update error 0x80070005 means Windows was refused permission to do something it needed to do. The code is the Windows error ERROR_ACCESS_DENIED, written in the form update errors use. A file, a folder, or a registry key was locked against the process that tried to change it, so the update stopped.

The short version: the place where the code appears decides the fix. If Windows Update fails, reset the update cache and repair the permissions on the update folders. If a Store app fails to install, clear the Store cache with wsreset.exe. If System Restore fails, run it from an administrator account with third-party antivirus paused. Work through the branch that matches your screen, then repair the system files with DISM and SFC if the error is still there.

First, work out where the error appears

The code alone never says which file or folder was refused, so note exactly what you were doing when it appeared. Open Settings, then Windows Update, then Update history, and look for the failed entry and its KB number. If the error came from the Store, note the app name. If it came from System Restore, note the date of the restore point you picked.

Where the error appearsWhat was refusedTry first
Windows UpdateWrite access to the update cacheReset the update cache
Microsoft Store app installWrite access for the app packageClear the Store cache
System RestoreWrite access to system filesRun as an administrator
Flowchart showing three branches for Windows Update error 0x80070005: Windows Update failure, Microsoft Store app install failure, and System Restore failure, each with its first fix

If you are not sure which branch you are in, treat it as a Windows Update failure, the most common case. If the code on your screen is 0x80070002 instead, that is a missing file rather than a refused one, and the fixes are different. Our guide to fixing Windows Update error 0x80070002 covers that code.

Before you start: two checks that take two minutes

Back up your personal files before you change anything. Several of the fixes below change permissions and rename system folders, so copy your documents and photos to a USB drive or to OneDrive first.

Then check that you are signed in with an administrator account. Some updates need administrator access, and parts of the update process run in your user account rather than as the system itself, so a standard account can hit an access denied error on a step the system account would pass. Open Settings, then Accounts, then Your info, and look under your name. If it says Standard user, sign out and sign in with an administrator account, or ask the person who manages the PC to install the update. Also check that the drive has room: Microsoft lists at least 16 GB of free space for a 32-bit upgrade and 20 GB for a 64-bit upgrade.

Branch 1: Windows Update fails with 0x80070005

Run the Windows Update troubleshooter

The troubleshooter is the right first step because it checks the update services and the common permission states on its own. Microsoft lists this code as an access denied error with insufficient permissions to install updates, and its own guide starts with this troubleshooter. On Windows 11, open Settings, then System, then Troubleshoot, then Other troubleshooters. Find Windows Update and select Run, then follow the instructions on screen. On Windows 10, the same troubleshooter sits under Settings, then Update and Security, then Troubleshoot, then Additional troubleshooters. Let it finish, restart if it asks you to, and try the update again.

Reset the update cache by renaming the folders

If the troubleshooter does not clear it, the downloaded update files themselves are the likely problem. The update cache lives in C:\Windows\SoftwareDistribution, and the catalogue database lives in C:\Windows\System32\catroot2. When the files inside those folders are corrupt, or the permissions on them have been changed, the update service cannot write new files over them. Renaming the folders forces Windows to build fresh ones with default permissions.

See also  How to Stop Windows 11 From Rearranging App Windows When a Monitor Wakes Up

Open Command Prompt as administrator: type cmd in the taskbar search box, right-click Command Prompt, and select Run as administrator, then select Yes. Type each command below on its own line, press Enter after each one, and wait for it to finish before typing the next. The first two stop the services, the next two rename the folders, and the last two start the services again.

  • net stop bits
  • net stop wuauserv
  • ren %systemroot%\softwaredistribution softwaredistribution.bak
  • ren %systemroot%\system32\catroot2 catroot2.bak
  • net start bits
  • net start wuauserv

Close the Command Prompt window and restart the computer, then open Settings, then Windows Update, and select Check for updates. Windows recreates both folders from scratch, so the update downloads again in full. Do not delete the .bak folders yet. If the update installs cleanly, you can delete them later.

Sequence diagram for resetting the Windows Update cache: stop the BITS and Windows Update services, rename the SoftwareDistribution and catroot2 folders, restart the services, then check for updates again

Repair the permissions on the update folders

If a fresh cache still fails with the same code, the permissions on the folders are the problem rather than their contents. The folders must be writable by the SYSTEM account and by the update services. Windows ships with a built-in tool called icacls for this job, and its reset switch restores the inherited permissions from the parent folder.

Open Command Prompt as administrator again and run this command, then press Enter and wait for it to finish. It walks through the SoftwareDistribution folder, resetting each item to the permissions it inherits from C:\Windows.

  • icacls C:\Windows\SoftwareDistribution /reset /t /c /q

Run the same command for the catalogue folder only if the first one does not fix the update: icacls C:\Windows\System32\catroot2 /reset /t /c /q. Restart the PC after each reset and try the update again. Two warnings matter here. First, run this command only on these two folders, never on the whole C drive or on C:\Windows itself, because resetting permissions across the system can break programs that rely on their own settings. Second, do not take ownership of these folders yourself. The update service expects the SYSTEM account and TrustedInstaller to own them.

Branch 2: a Microsoft Store app will not install or update

Start by clearing the Store cache. Close Microsoft Store completely, press Win plus R, type wsreset.exe, and press Enter. A blank Command Prompt window appears for a few seconds and closes on its own, then Microsoft Store opens again by itself. That blank window is normal. Go back to your Library and try the install again. Before you do, check that the Store itself is up to date: open Library and select Get updates, and let any Store update finish first.

If the cache clear does not fix it, repair the Store app, then reset it if repair is not enough. Open Settings, then Apps, then Installed apps, and find Microsoft Store. Select the three-dot menu next to it and choose Advanced options. On some Windows 11 builds the same page sits under Settings, then System, then System components, then Microsoft Store, then Advanced options. Select Repair first and test the install. Repair keeps the app data and fixes damaged configuration. If the install still fails, go back to the same page and select Reset, which returns the Store to a freshly installed state and clears its local data, so sign back in and try once more. If the app still refuses, move on to the DISM and SFC section below, because the problem is then in the system files the Store depends on.

See also  Fix: RDP Can't Connect to Remote Computer (8 Solutions)

Branch 3: System Restore fails with 0x80070005

System Restore writes system files, registry settings, drivers, and installed programs back to the state saved in a restore point, and it needs administrator rights and an uninterrupted write to do that. When it fails with access denied, check three things in order: the account, the security software, and the restore point.

First, run System Restore from an administrator account. Press Win plus R, type rstrui.exe, and press Enter. If User Account Control asks for permission, select Yes. Pick a restore point dated before the problem started, and if the date you want is missing, tick Show more restore points. Select Scan for affected programs before you confirm, because it shows which programs and drivers the restore will remove. Select Next, check the confirmation screen, select Finish, and let Windows restart. Do not turn the PC off while it runs.

Branch diagram for System Restore failing with error 0x80070005: check the administrator account, pause third-party antivirus, try Safe Mode, then confirm a restore point exists

Second, pause third-party antivirus and try again. Antivirus real-time protection can block the writes System Restore makes to protected system locations, and the block looks exactly like a permission failure. Pause the protection, run the restore, and turn it back on immediately afterwards, whether the restore worked or not. If the restore works with the antivirus paused, update the antivirus to its latest version. If it still fails, try the restore in Safe Mode, which starts Windows with a minimal set of drivers and startup programs.

One more check belongs in this branch. System Restore only works if a restore point exists, and System Protection, the feature that creates restore points, is off by default on Windows 11 and Windows 10. If the list is empty, there is nothing to restore from. Open Start, type Create a restore point, open the result, and look at the System Protection tab. If protection is off for the Windows drive, select the drive, select Configure, choose Turn on system protection, and select Apply. That setting only helps future problems, so if the list is empty, skip to the repair install section.

Repair the system files with DISM and SFC

The permission checks themselves depend on system files and the component store, and if those are damaged, every branch above can fail with the same code even when the permissions are right. Come here whenever a branch fix did not clear the error. Run DISM first and SFC second, because DISM repairs the Windows image that SFC relies on for its replacement files. Microsoft’s own DISM and SFC repair guide gives the same order and the same two commands.

Open Command Prompt as administrator. Type the first command, press Enter, and wait for it to finish. It can take several minutes, and it needs an internet connection, because it fetches fresh files from Windows Update. When it reports that the operation completed successfully, type the second command in the same window and wait until the scan reaches 100 percent. Do not close the window early.

Run thisWhat it doesRun it
DISM.exe /Online /Cleanup-Image /RestoreHealthRepairs the Windows image SFC uses for replacement filesFirst
sfc /scannowScans protected system files and replaces damaged onesSecond, in the same window

Read the result message when SFC finishes. No integrity violations found means the system files are healthy, so go back to the branch that matches your screen. Corrupt files repaired means the fix may already be in place, so restart the PC and try the update again. Corrupt files found but not repaired means DISM did not fully repair the image, so run DISM once more, restart, and run SFC again. If the second pass still cannot repair the files, move on to the repair install section.

See also  Fix Windows Update Error 80072EE2 in Windows 11 and 10

Check for software blocking the write

If every branch above has failed, the permissions may be correct while a program sitting between Windows and the disk refuses the write. Third-party antivirus is the usual suspect, and Microsoft names it directly in its troubleshooting steps for this exact code. Temporarily disable the real-time protection, try the update again, and turn the protection back on immediately afterwards. If the update installs while the protection is paused, the antivirus was the cause, so update it to its latest version. If the PC belongs to a workplace or a school, group policy can block update writes on purpose, and no permission fix on the PC will override it. In that case, ask the IT administrator to check the update policy.

What not to do: SubInACL and permission reset tools

Old guides for this error often tell you to download SubInACL, a Microsoft command line tool from the Windows Server 2003 Resource Kit, and run a script that resets permissions across the whole system. Do not follow that advice. The original Microsoft download is no longer available, the last version is 5.2.3790.1180, and the tool was never supported on anything later than Windows Server 2003. Copies still circulate on archive sites, but an archived copy of a twenty-year-old tool is not a current Microsoft release.

The same warning applies to third-party permission reset tools and to scripts that promise to fix all permissions in one click. A blanket permission reset is the wrong tool for this error, because the error is always about one specific folder or process, and a system-wide reset changes thousands of permissions you never meant to touch. Use the built-in tools instead: the icacls reset in Branch 1 targets one folder, the cache rename rebuilds two folders, and DISM and SFC repair the files the checks depend on.

When nothing works: a repair install

When this works: every branch fix and every repair tool has failed, which means the damage is spread through the system rather than sitting in one folder. A repair install, also called an in-place upgrade, reinstalls Windows over the current installation while keeping your personal files and apps. Download the Media Creation Tool from the Microsoft software download page, run it, and choose Upgrade this PC now. On the screen that asks what to keep, choose Keep personal files and apps. The PC restarts several times, so plug a laptop into power first.

A repair install is the honest last resort, not a shortcut. It is worth doing only after the branches above have all been tried, because it takes far longer than any of them and it still needs a backup first. If it also fails with 0x80070005, the cause is likely in the hardware, most often the drive itself, and the next step is a full backup followed by a clean installation, or a repair shop.

How to tell it is fixed, and how to stop it coming back

The error is fixed when the update, the Store install, or the restore completes without the code appearing. After the update installs, open Settings, then Windows Update, then Update history, and confirm the entry shows as successfully installed. After a Store fix, open the app once and confirm it launches. After a System Restore, check that the problem that sent you to System Restore is gone.

Error 0x80070005 looks alarming because it talks about access being denied, but it is usually a small, specific problem: the wrong folder permissions, a stuck cache, or a program blocking a write. Find the branch that matches where the code appeared, work that branch in order, and repair the system files if the branch fix does not clear it.

Osmanim
Scroll to Top