How can I abort a pending Windows Update cycle and reboot normally?


RickyMoose

Member
Member
Local time
6:38 PM
Posts
14
OS
W11 Pro
Hi All,

After looking at these two URL's and other links on the interweb I still do not have the full answer to a question that's been bugging me:


Here's the scenario... Imagine I am in a VM where the pending update icon 1714514057595.png is in the systray and I want to QUICKLY reboot normally as if no updates were pending in the first place.

I am looking for a script that will delete any pending update packages like the above script, but also force Windows to believe that the next reboot is a normal reboot that does not force me to wait to apply updates that do not exist after having reset/deleted them.


After running the script at:


This does do a reboot at the end which is fine but regardless of whatever deleting and resetting the script does, Windows still forced me to sit through the "You are x% There, please keep your computer on...".

1714514148028.png


Is there some other steps that can be added to the script or some other script that will also make Windows forget that any pending actions are needed after deleting the update cache?

I constantly bitten during testing by Windows updates either in a VM or on bare metal when using Rollback Rx (or just rebooting) where the current session is going to get blown away anyhow so I am trying to avoid the "forced update/please wait.." part of the process if at all possible instead of having to "hurry up and wait" all the time.

Also, I am aware that Windows has the option in the GUI to skip an update and reboot but since most of my reboots are scripted or kicked off via Rollback RX I am looking for a non-GUI method to do this action.
1714514501993.png

Is there anyway to clear the “dirty bit” so to speak for a pending update after deleting the update cache?


I should also mention that @Brink 's script did generate a few "access is denied" messages on an admin account after being elevated, so it could be that the would have done what I am looking for but there is some other factor in play.

1714515148169.png

1714515382789.png


Thanks
 
Windows Build/Version
W11 23h2

My Computer

System One

  • OS
    W11 Pro
In this video, i will guide you on how to fix Windows update is stuck in an endless loop on Windows 7, Windows 8, Windows 10 and Windows 11.

 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1
In this video, i will guide you on how to fix Windows update is stuck in an endless loop on Windows 7, Windows 8, Windows 10 and Windows 11.

Hi @FreeBooter

Thanks for the information, but does not seem to address the issue.
After some syntax trial and error I was able to run it like this:

DISM /online /Cleanup-Image /Revertpendingactions

However running just the dism command and rebooting or even doing a run of the @Brink script and then running the dism command the result was the same.


Windows still thinks there are pending actions to perform even though the updates were deleted/reset before hand so in the end you still get the "please wait" message on reboot.



1714608382058.png


If after shutdown /r I get to this step then the solution has failed to achieve the desired outcome:

1714608397158.png



Thanks-
 

My Computer

System One

  • OS
    W11 Pro
Please don't manually rename or delete the pending.xml file, that's just going to cause a potentially big headache (please read: Why you don’t want to edit your pending.xml to resolve 0xC0000034 issues). The correct method is to use /RevertPendingActions as you have done, however, that doesn't stop Windows was rebuilding the pending.xml file again and then applying the changes over a reboot.

The only way that this may possibly work is to actually remove the update packages from the registry because I doubt even wusa would work here, although, you can try it:

Code:
wusa /uninstall /KB:<kbnumber>
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
Please don't manually rename or delete the pending.xml file, that's just going to cause a potentially big headache (please read: Why you don’t want to edit your pending.xml to resolve 0xC0000034 issues). The correct method is to use /RevertPendingActions as you have done, however, that doesn't stop Windows was rebuilding the pending.xml file again and then applying the changes over a reboot.

The only way that this may possibly work is to actually remove the update packages from the registry because I doubt even wusa would work here, although, you can try it:

Code:
wusa /uninstall /KB:<kbnumber>
Hi, @x BlueRobot,


I tried your suggestion by running:

DISM /online /Cleanup-Image /Revertpendingactions


And then I found a "possible" way to discover pending update KB numbers to leverage the wusa that you described. I am not sure if this is valid code but MS copilot gave me this snippet to find "pending updates":

Powershell:
$u = New-Object -ComObject Microsoft.Update.Session
$u.ClientApplicationID = 'MSDN Sample Script'
$s = $u.CreateUpdateSearcher()
$r = $s.Search('IsInstalled=0')
$r.updates | select -ExpandProperty Title

The output of this was:

2024-04 Cumulative Update Preview for .NET Framework 3.5 and 4.8.1 for Windows 11, version 22H2 for x64 (KB5037591)
Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.409.657.0) - Current Channel (Broad)
VMware, Inc. - Display - 9.17.7.2
2024-04 Cumulative Update for Windows 11 Version 22H2 for x64-based Systems (KB5036893)


I got a few trial and error but eventually figured out that the syntax should be
wusa /uninstall /kb:5037591

and not things like (eg: numbers only, not Alpha numeric for the KB number):
wusa /uninstall /kb:KB5037591


Unfortunately wusa simply returns that these updates are not currently installed so that there is nothing to uninstall.
So I guess I'm kinda back at square one.

1714755341523.png1714755381784.png


1714755540655.png

So I am not sure if the Powershell script was accurate representation of what is pending to be installed versus what windows update GUI reports.
I would have expected them both to contain the same information as far as the number of KB's pending to apply, but in any case I still don't have an effective way to make windows "forget" before the next reboot that any of this is pending.

It may be the case that there just isn't a way to do this effectively without still having "please wait" steps to contend with, but perhaps your or someone else will have another idea for me to try.



Thanks.
 

Attachments

  • 1714755151550.png
    1714755151550.png
    14.5 KB · Views: 1
  • 1714755215594.png
    1714755215594.png
    3.7 KB · Views: 1

My Computer

System One

  • OS
    W11 Pro
Back
Top Bottom