CODYQX4 Posted July 12, 2008 Posted July 12, 2008 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?
mazmorbid Posted July 12, 2008 Posted July 12, 2008 Good question, its such an ugly box why did they have to make it look like your system has just failed !?
gunsmokingman Posted July 12, 2008 Posted July 12, 2008 You could use a VBS script as the last entry in your RuOnceEx that will hide the dialogSave as ShutDown.vbsWScript.Sleep 60000CreateObject("Wscript.Shell").Run("shutdown.exe -r -f"),0,TrueREG ADD %KEY%\999 /VE /D "Shut Down Computer" /fREG ADD %KEY%\999 /V 1 /D "%Install%\Shutdown\ShutDown.vbs" /f
CODYQX4 Posted July 12, 2008 Author Posted July 12, 2008 Thank you, I will give it a go now ...Me too!
mazmorbid Posted July 12, 2008 Posted July 12, 2008 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 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
gunsmokingman Posted July 13, 2008 Posted July 13, 2008 Here try this new code I have tested this and it worksSave 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
mazmorbid Posted July 13, 2008 Posted July 13, 2008 Thanks gunsmokingman, but that didn't work either just shut it down and didn't restart 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 ..
Innocent Devil Posted July 13, 2008 Posted July 13, 2008 why not use psShutdown frm SysinernalsSuite ?psshutdown.exe -f -r -t <time> -v 0
CODYQX4 Posted July 15, 2008 Author Posted July 15, 2008 why not use psShutdown frm SysinernalsSuite ?psshutdown.exe -f -r -t <time> -v 0Thanks, it hid the countdown, but you did forget to list a very important switch, /accepteula. Without it, an unattended install gets stopped dead.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now