用于标记系统是否需要重启动的注册表键值

最近因为工作原因,需要找到一个可靠的方法判断当前系统是否存在pending reboot。

综合了一下,有如下注册表键值可以做参考:

  1. HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
  2. HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations2
  3. HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired
  4. HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile
  5. HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending
  6. HKLM\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts
  7. HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName 和 HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName (这两个键值用于标记计算机是否已经改名但并未重启生效)

正常情况下,如果不存在pending reboot,键1.~5.应该是不存在的,键6的值应该是0,而7.中的两个键的值应该相等。

参考链接:

http://technet.microsoft.com/en-us/library/cc164360(EXCHG.80).aspx

http://support.microsoft.com/kb/2014837

http://technet.microsoft.com/zh-cn/library/ee649098.aspx 

原文地址:https://www.cnblogs.com/k330/p/Check_Pending_Reboot_By_Registry_Key.html