Software Deployment Question

How to determine if a PC is reboot pending

09/11/2008 57218 views

I'm wondering if there is a global registry key or other flag available that can be used to determine if a PC is reboot pending? I've found this key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations", but it would only be set if the reboot was required for file renames. I'm concerned that if a reboot is required for some other reason and this would not be reflected in this key.

Thanks for any advice
0 Comments   [ + ] Show comments


Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

All Answers

I only think there exist two cases when an actual reboot is required; files in-use which PendingFileRenameOperations is there to handle and kernel services to be started or filterdrivers to be unloaded. I don't think there is any way to find out for the latter.
Answered 09/11/2008 by: AngelD
Red Belt

So in that case I should probably capture the exit code and create my own flag then. At least that way I know I'm going to capture all reboot requests.

Thanks for the quick response AngelD.
Answered 09/12/2008 by: brettski
Purple Belt

Just bringing up this again.

Does anyone know how to detect if a Group Policy deployment has a reboot pending?

For example, a workstation has 2 applications assigned to it. The first application has a reboot trigger, but AD holds the reboots until the end of the deployment and so starts installing the second application.

How can I condition the second application so that it won't start while a reboot is pending?
Does anyone know how the GP installation tracks if a reboot is requested?

(Besides the file copy pending registry key, since a reboot request can be forcibly triggered by Windows Installer.)

Answered 09/29/2009 by: jendres
Senior Yellow Belt

Sorry Jeff, I am using Task Sequences through SCCM, so can't help you out as I worked around the issue using wrapper scripts and Task Sequence Variables. Hopefully someone else here has a better idea how it works.
Answered 09/29/2009 by: brettski
Purple Belt

IIRC, MSIExec exits with an exit code of 3010 if a reboot is required. I haven't looked but perhaps there's a testable property for the WindowsInstaller.Installer object?

I would imagine GP performs its magic by looking at system messages via API calls.
Answered 09/30/2009 by: VBScab
Red Belt

Reopening this thread again...

Has any one found solution? How do I know if system is pending reboot?
Answered 09/16/2010 by: murali.bhat
Purple Belt

Try this tool - WhyReboot - it's free.

It will show you what is going on and why the system belives it requires a reboot.

Not exactly the answer for your issue, but should point you in the right direction.

Hope this helps,

Answered 09/16/2010 by: dunnpy
Red Belt

The WhyReboot tool is awesome!! Thank you, dunnpy!!
Answered 03/12/2012 by: awingren
8th Degree Black Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ