Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows Server 2022 / How to Cancel Windows Update Pending Restart Loop

May 6, 2025

How to Cancel Windows Update Pending Restart Loop

In rare cases, Windows may repeatedly prompt you to restart the computer after installing updates. Moreover, Windows Update continues to display the “Restart required, Pending restart” message no matter how many times you restart a computer.

Windows Update keeps asking to restart

This issue may be caused by a failed Windows Update installation where the update failed to apply changes to the system image and remained in an incomplete (pending) state. Let’s try to cancel the pending update installation and break the update restart loop.

Open a PowerShell console as an administrator and check for any update packages that require the computer to restart (with PendingReboot or InstallPending status). Run the command:

dism /online /get-packages /format:table | Select-String "Pending"

Or this PowerShell command (provides cleaner output):

Get-WindowsPackage -Online | Where-Object { $_.PackageState -like '*Pending*' }

Get-WindowsPackage - pending reboot update

In this example, Windows Update indicates that a restart is required to complete the package installation and to apply the changes. If, after restarting the computer, the component status still shows a pending reboot, you’ll need to cancel the deferred update installation.

Run the command shutdown /f /r /o /t 0 to restart a computer and boot into Windows Recovery environment (or boot from any LiveCD, DaRT recovery disk, or a Windows installation image).

To cancel scheduled updates with a ‘Pending’ status, run the following command (assuming that the Windows partition is assigned the C:\ drive letter )

DISM /image:C:\ /ScratchDir:C: /cleanup-image /RevertPendingActions

This will undo any pending actions from previous Windows Update maintenance operations.

If the DISM command doesn’t help, try manually canceling pending updates by deleting the pending.xml file:

del C:\Windows\WinSxS\pending.xml
del C:\Windows\WinSxS\cleanup.xml (the file may be missing.)
del C:\Windows\SoftwareDistribution\Download\*.* (clear the cache of downloaded updates)

delete pending.xml file to exit endless reboot required

Then run regedit and load the registry hive C:\WINDOWS\system32\config\Software from the offline Windows image.

Navigate to the loaded registry hive, expand HKLM\SYSTEM\CurrentControlSet\Control\Session Manager key and delete the PendingFileRenameOperations parameter.

Clear the PendingFileRenameOperations registry option

Save the changes to the file by unloading the registry hive (File -> Unload hive).

Restart the computer and verify that the pending Windows updates no longer appear in the list.

Then, verify the Windows image integrity and repair the system image files by using the following commands:

DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

0 comment
0
Facebook Twitter Google + Pinterest
Questions and AnswersWindows 11Windows Server 2022
previous post
View Windows Update History with PowerShell (CMD)
next post
Configure NTP Time Source for Active Directory Domain

Related Reading

Adding Multiple Alternate DNS Names for a Windows...

September 3, 2024

Exclude a Specific User or Computer from Group...

March 16, 2025

How to Prefer IPv4 over IPv6 in Windows...

April 15, 2025

Collecting Windows and Active Directory Event Logs with...

February 7, 2025

Fix: The referenced assembly could not be found...

March 25, 2025

Send a WhatsApp Message from the CommandLine (Shell)

December 3, 2024

How to Hide (Block) a Specific Windows Update

March 3, 2025

How to Write Logs to the Windows Event...

March 11, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fix: Windows Update Tab (Button) is Missing from Settings
  • Permanently Disable Driver Signature Enforcement on Windows 11
  • Fix: Your IT Administrator Has Limited Access to Virus & Threat Protection
  • Fix: Multiple Connections to a Server or Shared Resources by the Same User
  • How to Add or Reinstall the Microsoft PDF Printer on Windows
  • Mounting an ISO Image File in Windows
  • VPN Error 633: The modem is already in use or not configured
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top