RE: Restart Pending

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



¿porque en windows 2000 no funciona?
solo sale 1 path, y segun el registro hay varios.



"J Ford" wrote:

There are quite a few cmd utils to detect it; however if you want to WMI
script it you can use WMI to check for the existence of
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\PendingFileRenameOperations" which I believe is a REG_MULTI_SZ

Which is what most of the cmd utils check to see if a reboot is
pending/needed.

Perhaps...
<script>
On Error Resume Next

Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_MULTI_SZ = 7

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager"
strValueName = "PendingFileRenameOperations"

oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrValues

If Not IsNull(arrValues) Then
For Each strValue In arrValues
Wscript.Echo strValue
Next
Else
Wscript.Echo "No Pending Reboot"
End If

</script>


"Brad McDonald" wrote:

Hello,

Has anyone come up with a WMI query that determines if a system has a
pending restart waiting in the wings, following Windows Update?

I know the CreateObject("Microsoft.Update.SystemInfo"), but I'm looking to
query these systems remotely.

Thanks
Brad
.



Relevant Pages

  • Re: Really slow to get information from Win32_UserAccount
    ... This should get the fullname of current user (local as well as ... WMI provider for the Win32_UserAccount class could avoid having to ... The only way to find out really, is to try my script and see what ... If you mean all the machines that would run the code then no, some of them could be Windows NT 4.0 or Windows 9x.. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: WMI Timeout on Remote Computer
    ... >> I am having problems with running WMI query against a few remote Windows ... the script will go on to the next computer? ... I read that the WMI timeout is set really high ...
    (microsoft.public.scripting.vbscript)
  • RE: MS03-039 Deploy Script
    ... Thanks to Diego for sharing the script with us. ... To run WMI-based scripts, we can install Windows ... Management Instrumentation (WMI) CORE 1.5 on these systems: ... |>>helps deploying the patch using WMI: ...
    (microsoft.public.security)
  • Re: What is the difference between WSH, VBScript and WMI (and ADSI) ?
    ... WMI networking methods are only supported on Windows NT-based platforms, ... Network-Related WMI Methods Fail on Windows 95, Windows 98, Windows Me ... Explorer 4.0 or later with WSH and ADSI installed. ... Windows Script Host supports scripts that are written in Visual Basic ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: What is the difference between WSH, VBScript and WMI (and ADSI) ?
    ... WMI networking methods are only supported on Windows NT-based platforms, ... Network-Related WMI Methods Fail on Windows 95, Windows 98, Windows Me ... Explorer 4.0 or later with WSH and ADSI installed. ... Windows Script Host supports scripts that are written in Visual Basic ...
    (microsoft.public.windowsxp.general)