Kinook Software Forums

Kinook Software Forums (
-   [VBP] Third Party Tools (
-   -   VB reboot script (

Buildboy 09-04-2007 03:17 PM

VB reboot script
I have a VB script to force reboot depending on the Error code I get back from my executable, it works on 2K3 and XP but it fails on 2K with the following error,

Error in Run Script (VBScript) script code at Line 2, Column 1 (Generic failure)

here is the script, any idea why?

Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")

for each OpSys in OpSysSet

Thanks :)

kinook 09-04-2007 05:30 PM

Not really, but here are some possibilities:

That code (and the Shut Down action) works ok in our tests on a clean W2K SP4 box.

Buildboy 09-04-2007 05:55 PM

Thanks for the quick reply, the interesting part is when I just run this script some times it fails and some times it manages to reboot the system, is there a better way to write this?

All times are GMT -5. The time now is 09:50 AM.

Copyright 1999-2019 Kinook Software, Inc.