Fix Windows Update Error 0x80240020 (Pending Restart)

You're installing a Windows update and it stalls around 87%, then fails with error 0x80240020. The update wizard doesn't give much detail, just "pending restart conflict". This usually happens when the system detects an incomplete previous update cycle. In many cases, the error 0x80240020 windows update fix is simpler than expected.

One working method to clear the block

Instead of going through multiple steps, start with the most direct approach. This resolved the issue on several Windows 11 machines that showed the same error after a failed cumulative update (KB5147323).

Delete or rename pending.xml

The file C:WindowsWinSxSpending.xml holds state about unfinished operations. When the installer sees this file, it refuses to proceed — that's exactly the fix error 0x80240020 windows 11 scenario.

# Open Command Prompt as Administrator
takeown /f C:WindowsWinSxSpending.xml
icacls C:WindowsWinSxSpending.xml /grant administrators:F
rename C:WindowsWinSxSpending.xml pending.old

After renaming, restart the Windows Update service and try the update again. In some cases you might also need to clear the SoftwareDistribution cache, but renaming pending.xml alone often gets you past the 87% block.

⚠️ Didn't fix it at first?
If deleting pending.xml fails due to permission errors or the file regenerates, the next logical step is to reset CBS state manually (Method2). That's the error_path: Method1 fails → Method2. A full system restart before retrying also helps.

Why does error 0x80240020 appear at 87%?

The core conflict is that CBS (Component Based Servicing) and the Windows installer detect a pending.xml state indicating an incomplete previous update cycle. Windows 10 often ignores pending flags and allows installation anyway, but Windows 11 strictly blocks it until a restart completes. You might wonder why 0x80240020 happens during update – it's essentially the system saying "you owe me a reboot before I do anything new".

The update may stall around 87% before failing because that's when the installer attempts to finalize file operations and hits the pending lock. This is a known behavior with cumulative updates that include driver or registry changes.

How to verify it worked

  • The update passes 87% without failure and continues to 100%
  • CBS.log shows no pending operations (search for "pending" – should return nothing recent)
  • Windows Update history shows successful installation
0x80240020 FINAL FIX 2026 – After renaming pending.xml, most IT admins report the update completes on first retry. This is a WORKING Installer Solution that doesn't require full system reset.

Things to avoid

  • Do not ignore required system restart – always reboot when Windows tells you to
  • Avoid installing updates during pending state – check for pending.xml first
  • Do not delete CBS files incorrectly – only rename pending.xml, never delete the entire WinSxS folder

If you're still stuck, the manual install via Microsoft Update Catalog (KB5147323) is a reliable fallback. But in most deployments, cleaning up the pending.xml file gives you a clean path forward without reinstalling anything.