Avatar of Member_2_6492660_1
Member_2_6492660_1
Flag for United States of America asked on

Pending Rebot Status on many computers how to clear

All Windows Platforms  Windows 10  Windows 8.1 Windows 7 Windows 2012 R2, Windows 16, Windows 19

I run a script that reports pending reboots on each computer on my network.
I recently changed this script because the one I was using failed to connect to all my computers.  Needed Remote Registry Service running and other winrm issues.

I discovered this after trying to install Exchange Management Tools on my New Windows 10 Pro computer ,   It keep telling me I had a pending restart.

So after some digging and some help from you guys I found this  value in my registry that caused the problem

"PendingFileRenameOperations"  is the Key

I ran this command against all my computers and this is an example of what I found

PS C:\util> invoke-command -computer SERV027-n1 -scriptblock {Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager'}                                                                           

AutoChkTimeout                 : 10
BootExecute                    : {autocheck autochk /q /v *}
BootShell                      : C:\Windows\system32\bootim.exe
CriticalSectionTimeout         : 2592000
ExcludeFromKnownDlls           : {}
GlobalFlag                     : 0
GlobalFlag2                    : 0
HeapDeCommitFreeBlockThreshold : 0
HeapDeCommitTotalFreeThreshold : 0
HeapSegmentCommit              : 0
HeapSegmentReserve             : 0
InitConsoleFlags               : 0
NumberOfInitialSessions        : 2
ObjectDirectories              : {\Windows, \RPC Control}
ProcessorControl               : 2
ProtectionMode                 : 1
ResourceTimeoutCount           : 150
RunLevelExecute                : {WinInit, ServiceControlManager}
RunLevelValidate               : {ServiceControlManager}
SETUPEXECUTE                   : {}
AutoChkSkipSystemPartition     : 0
PendingFileRenameOperations    : {\??\C:\Users\spadmin\AppData\Local\Temp\TeamViewer\TVFile17.bak_2019-11-20-06-43-56.t
                                 mp, }
PSPath                         : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro
                                 l\Session Manager
PSParentPath                   : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro
                                 l
PSChildName                    : Session Manager
PSProvider                     : Microsoft.PowerShell.Core\Registry
PSComputerName                 : TGCS027-n1
RunspaceId                     : 8b617b75-4131-4b77-b181-f145044acba4

Open in new window



As you can see the PendingFileRenameOperations" key exists and has a value.

my report returns the SERV027-N1 is TRUE which means the Key exists.

After several restarts on different computers the Key remains.

Of all my computers only two show FALSE no Pending Reboot required.

I can delete the Key manually

I was able to delete the key using powershell


invoke-command -computer SERV001 -scriptblock {reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations /f}

Open in new window


Question is why do I need to delete this key?  

A restart of the computer should clear this key correct?

Some install must have failed along the way.

How to I clear this?

Thank you

Tom
Windows 10Windows OSWindows Server 2012Windows 7

Avatar of undefined
Last Comment
Member_2_6492660_1

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Member_2_6492660_1

ASKER
Qlemo

Any thoughts on why the value comes back even after I remove/delete the key?

Last night I deleted the key on this machine and now today

PS C:\util> invoke-command -computer TGCS005-N2 -scriptblock {(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager' -Name PendingFileRenameOperations ).PendingFileRenameOperations}                                         \??\C:\Windows\system32\spool\DRIVERS\x64\V4Connections\3B85FE2B-443B-41CE-AA1B-80EA51E0AB58\dc319786.BUD

\??\C:\Windows\system32\spool\DRIVERS\x64\V4Connections\3B85FE2B-443B-41CE-AA1B-80EA51E0AB58\dc319786.BUD

\??\C:\Windows\system32\spool\DRIVERS\x64\V4Connections\3B85FE2B-443B-41CE-AA1B-80EA51E0AB58\dc319786.BUD

\??\C:\Windows\system32\spool\DRIVERS\x64\V4Connections\3B85FE2B-443B-41CE-AA1B-80EA51E0AB58\dc319786.BUD

Open in new window


These are similar entries on most of my machines.
Qlemo

Those are system files generated automatically after a printer driver update. They should not appear as pending file operations. I have no clue why they do. But maybe a clean install of printer drivers resolves this issue.
Member_2_6492660_1

ASKER
We use a GPO to deploy printers  

Print drivers are on the print server.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Member_2_6492660_1

ASKER
Qlemo

I wrote a powershell script to clear them it runs once a day.

Thank you