Fixing it
The fix is to edit a registry key inside the mounted WIM directly. Before starting, confirm the WIM is actually mounted (viaGet-WindowsImage -Mounted or DISM), then load its offline registry hive:
reg load HKLM\wimkey {mounted_location}\windows\system32\config\software
Replace {mounted_location} with the actual path where your WIM is mounted.
Once loaded, open regedit and you’ll see a new wimkey node under HKEY_LOCAL_MACHINE. Browse to:
SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\SessionsPendingMake sure your account has full permissions on this key — right-click it, choose Permissions, and grant yourself Full Control if it’s currently restricted. Find the Exclusive DWORD value under that key. It will typically be set to
3 — change it to 0.
Once that’s done, unload the registry hive again so the WIM can be unmounted and committed cleanly:
reg unload HKLM\wimkeyGo back to your offline update process and re-run it — it should now proceed without the pending-update error blocking it.
A Built-In Alternative: DISM /RevertPendingActions (Updated for 2026)
Rather than loading the offline hive and editing the Exclusive DWORD by hand, DISM has a purpose-built switch for exactly this pending-servicing-state problem, and it’s still current in 2026:Dism /Image:<mount_dir> /Cleanup-Image /RevertPendingActionsMicrosoft’s own description: it reverts all pending actions left over from previous servicing operations on the image — which is the same pending-update state that causes the injection error above. One important scope limitation to know before reaching for it:
/RevertPendingActions only works against an offline, mounted image (/Image:) — there is no supported /Online equivalent, so it can’t be used to fix a running, booted system. Microsoft explicitly recommends it for system-recovery scenarios on an image that failed to boot, which makes it a good first thing to try on a stuck OSD WIM before falling back to the manual registry edit above.
Related tip: if you’re injecting updates into offline images regularly, adding /PreventPending to your /Add-Package calls avoids creating this pending-action state in the first place.
Resources
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.