Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-04-2007, 02:17 PM
Buildboy Buildboy is online now
Registered User
 
Join Date: 12-07-2006
Posts: 12
VB reboot script

Hi,
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
OpSys.Reboot()
next


Thanks

Last edited by Buildboy; 09-04-2007 at 03:46 PM.
Reply With Quote
  #2  
Old 09-04-2007, 04:30 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Not really, but here are some possibilities:
http://www.google.com/search?q=winmg...c%20failure%22

That code (and the Shut Down action) works ok in our tests on a clean W2K SP4 box.
Reply With Quote
  #3  
Old 09-04-2007, 04:55 PM
Buildboy Buildboy is online now
Registered User
 
Join Date: 12-07-2006
Posts: 12
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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 05:32 PM.


Copyright © 1999-2023 Kinook Software, Inc.