Jump to content

Recommended Posts

Posted

I want to time a shutdown to occur 60 seconds after RunOnceEx finishes on XP Professional SP3, but I don't want the annoying, ugly timer box, or any batch windows to appear at all. How can I accomplish this?


Posted

You could use a VBS script as the last entry in your RuOnceEx that will hide the dialog

Save as ShutDown.vbs

WScript.Sleep 60000
CreateObject("Wscript.Shell").Run("shutdown.exe -r -f"),0,True

REG ADD %KEY%\999 /VE /D "Shut Down Computer" /f
REG ADD %KEY%\999 /V 1 /D "%Install%\Shutdown\ShutDown.vbs" /f

Posted

I can't get this to work, I have done everything you said but it still gives me the shutdown screen with 30 seconds to reboot :realmad: I did delete the old reboot info from my cleanup.cmd ?? 3 times I have tried now with the same result, I'm sure it worked the 1st time I tried it :crazy:

Posted

Here try this new code I have tested this and it works

Save As Shutdown.vbs

 WScript.Sleep 60000
Dim Col, Obj, Wmi
Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
Set Obj = Wmi.ExecQuery("Select * from Win32_OperatingSystem")
For Each Col in Obj
Col.Shutdown(2)
Next

Posted

Thanks gunsmokingman, but that didn't work either :huh: just shut it down and didn't restart :wacko: I just put this "shutdown.exe -r -f -t 00" into a program called "Quick Batch File Compiler" and it worked perfect .. I also put that same command into a .bat file but I prefer using the .exe QBFC made as it seems to happen alot faster ..

Posted
why not use psShutdown frm SysinernalsSuite ?

psshutdown.exe -f -r -t <time> -v 0

Thanks, it hid the countdown, but you did forget to list a very important switch, /accepteula. Without it, an unattended install gets stopped dead. :wacko:

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...