Windows Update Injection Errors: Fixing a Mounted WIM Failure

If you’re injecting Windows Updates into a mounted WIM file as part of building an OSD image, you can run into errors partway through processing the updates. This usually happens because the mounted WIM still thinks it has updates pending from a previous session, even though the file itself isn’t actually mid-update. Fixing it The […]

Errors When Trying To Inject Offline Windows Updates Into A Mounted
If you’re injecting Windows Updates into a mounted WIM file as part of building an OSD image, you can run into errors partway through processing the updates. This usually happens because the mounted WIM still thinks it has updates pending from a previous session, even though the file itself isn’t actually mid-update.

Fixing it

The fix is to edit a registry key inside the mounted WIM directly. Before starting, confirm the WIM is actually mounted (via Get-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\SessionsPending
Make 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\wimkey
Go 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 /RevertPendingActions
Microsoft’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

WIMerror 2 4

Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.