大网数据广告活动
启动与系统组件

Troubleshoot Windows Update Error 0x80070005

· 52CE 我爱测

Discusses how to fix Windows Update error 0x80070005 (E_ACCESSDENIED). This error occurs if the update process can't access required files, folders, or registry entries.

Summary

Windows Update error 0x80070005 (E_ACCESSDENIED) occurs if the update process can't access required files, folders, or registry entries. This error typically indicates a permissions problem that affects the Windows component store, the Software Distribution folder, or related system resources.

This article provides steps to resolve this issue on supported versions of Windows client, Windows Server, and Microsoft Azure Virtual Machines (VMs).

Symptoms

You install a Windows update, but the installation fails, and you see error code 0x80070005 (E_ACCESSDENIED) reported.

To get more information, review the following resources:

  1. Review the WindowsUpdate.log file or the CBS.log file. Look for entries that resemble the following example:
Error                 CBS    Failed to create file. [HRESULT = 0x80070005 - E_ACCESSDENIED]
Error                 CBS    Failed to internally open package. [HRESULT = 0x80070005 - E_ACCESSDENIED]
  1. Review the Windows Update log. To generate a static copy of the log file, open a Windows PowerShell Command Prompt window, and then run the following cmdlet:
Get-WindowsUpdateLog

Search the output for 0x80070005 entries. For more information about the log file, see Windows Update log files.

Cause

This error occurs if one of the following conditions exists:

  • The TrustedInstaller service account doesn't have permissions on the %windir%\WinSxS folder or the %windir%\SoftwareDistribution folder.
  • The permissions on the registry subkey HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing aren't correct.
  • A third-party antivirus or security tool locked update-related files or folders.
  • The SYSTEM account doesn't have the Full Control permission on the %windir% folder.
  • A Group Policy setting or a management agent restricted write access to system directories.

Note:
%windir% represents the Windows system folder. The default folder name and location is "C:\Windows."

Resolution

Important:
Before you troubleshoot this issue, back up the operating system disk. For information about this process for VMs, see About Azure Virtual Machine restore.

Step 1: Reset the permissions on the component store

To reset the default permissions on the Windows component store, open an administrative Command Prompt window, and then run the following commands:

icacls "%windir%\WinSxS" /reset /t /c /q
icacls "%windir%\SoftwareDistribution" /reset /t /c /q

After you run these commands, restart the computer, and try again to install the update. If the update still doesn't install, go to step 2.

Step 2: Make sure that TrustedInstaller owns the WinSxS folder

To designate that the TrustedInstaller account owns the WinSxS folder, run the following command at the command prompt:

icacls "%windir%\WinSxS" /setowner "NT SERVICE\TrustedInstaller" /t /c /q

After you run these commands, restart the computer, and try again to install the update. If the update still doesn't install, go to step 3.

Step 3: Reset Windows Update components

If the error persists, reset all Windows Update components. At the command prompt, run the following commands:

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

After you run these commands, restart the computer, and try again to install the update. If the update still doesn't install, go to step 4.

Step 4: Repair the component store

To repair the component store, run the following command at the command prompt:

DISM /Online /Cleanup-Image /RestoreHealth

Note:
By default, DISM uses Windows Update as a repair source. For information about how to specify a different repair source, see Repair a Windows Image.

After you run this command, restart the computer, and try again to install the update. If the update still doesn't install, go to step 5.

Step 5: Check system file integrity

To verify the integrity of the system files, run the following command at the command prompt:

sfc /scannow

If this command identifies issues, see Use the System File Checker tool to repair missing or corrupted system files.

After this command finishes without errors, restart the computer. Try again to install the update. If it still doesn't install, go to step 6.

Step 6: Check for third-party interference

To make sure that third-party applications or drivers don't interfere in the update process, follow these steps:

  1. On the affected computer, temporarily disable real-time antivirus protection.

  2. To list the file system filter drivers, run the following command at the command prompt:

    fltmc
    
  3. If the list includes a non-Microsoft filter driver, temporarily unload it by running the following command:

    fltmc unload <DriverName>
    

    [!NOTE]
    In this command, <DriverName> represents the name of the driver as listed by the fltmc command.

  4. After the tool finishes, restart the computer, and try again to install the update. If the update still doesn't install, take one of the following actions:

    • If the list includes more than one non-Microsoft filter driver, repeat the fltmc unload command to unload each of these drivers, and then try again to install the update.
    • If the affected computer is a VM, go to step 7.
    • Contact Microsoft Support for assistance.

Step 7: Use the Run Command reset tool (Azure)

If the previous steps don't resolve the issue on an Azure VM, try the Azure VM Windows Update Reset Tool. You can run the tool directly from the VM's Azure portal page by using Operations > Run command. When you use this method, you don't have to sign in to the VM.

This tool resets the Windows Update servicing stack. This action clears memory-related lock states in the update agent.

After you run the tool, try again to install the update. If the update still doesn't install, go to step 8.

Step 8: Use a repair VM (Azure)

If the reset tool doesn't fix the issue, or the VM can't start:

  1. Create a repair VM by using Azure VM repair commands.

  2. Attach the affected operating system disk to the repair VM.

  3. To reset the default permissions on the Windows component store, open an administrative Command Prompt window, and then run the following commands:

    icacls "%windir%\WinSxS" /reset /t /c /q
    icacls "%windir%\SoftwareDistribution" /reset /t /c /q
    
  4. To designate that the TrustedInstaller account owns the WinSxS folder, run the following command at the command prompt:

    icacls "%windir%\WinSxS" /setowner "NT SERVICE\TrustedInstaller" /t /c /q
    
  5. Make sure that you have an offline operating system image available, and then run the following command at the command prompt:

    DISM /Image:<Drive>:\ /Cleanup-Image /RestoreHealth
    

    [!NOTE]

    • In this command, <Drive> represents the drive letter of the affected operating system disk.
    • By default, DISM uses Windows Update as a repair source. For information about how to specify a different repair source, see Repair a Windows Image.
  6. To make sure that third-party applications or drivers don't interfere in the update process, follow these steps:

    1. On the affected computer, temporarily disable real-time antivirus protection.

    2. To list the file system filter drivers, run the following command at the command prompt:

      fltmc
      
    3. If the list includes non-Microsoft filter drivers, temporarily unload them by running the following command for each non-Microsoft driver in the list:

      fltmc unload <DriverName>
      

      [!NOTE]
      In this command, <DriverName> represents the name of the driver as listed by the fltmc command.

  7. Reattach the repaired disk to the original VM.

  8. Try again to install the update. If the update still doesn't install, contact Microsoft Support for assistance.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- ✅ Supported versions of Azure Virtual Machine - ✅ Supported versions of Windows Client - ✅ Supported versions of Windows Server · Source date 05/05/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。