July 12, 200818 yr 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?
July 12, 200818 yr Good question, its such an ugly box why did they have to make it look like your system has just failed !?
July 12, 200818 yr 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
July 12, 200818 yr 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
July 13, 200818 yr 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
July 13, 200818 yr 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 ..
July 15, 200818 yr Author 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.
Create an account or sign in to comment