/build/static/layout/Breadcrumb_cap_w.png

Reboot after Post install runs during scripted install

How can I set the agent to reboot after the post imaging installs run? As of right now everything is installed and works fine how ever the user is left logged in as administrator... I'd like the installs to run then after the cleanup task for the system to reboot it's self. I know I could force the last MSI to reboot but then I'd miss out on the cleanup task.

Thanks for any thoughts!
Dennis

0 Comments   [ + ] Show comments

Answers (3)

Posted by: ncmonag 14 years ago
Senior Yellow Belt
0
Try making your last task a batch file that adds a command to RunOnce, it shouldn't run until after the RunOnceEX post-install tasks finish. Here's something similar to what I've done, Install.bat is zipped along with a folder with the path structure of C\WINDOWS\Temp\PostPost.bat it seems a bit dirty but works pretty well, you could probably just add the Shutdown command to RunOnce but I like the .bat because it gives me an easy way to add small tweaks after everything finishes.

Install.bat
XCOPY /V/Y/I/E "%~dp0C" %SYSTEMDRIVE%\
REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v P1 /t REG_SZ /d "CMD /C \"%WINDIR%\Temp\PostPost.bat\"" /f

PostPost.bat
%systemroot%\system32\shutdown.exe -r -f -t 99 -c "The scripted install is now complete. This system will automaticaly reboot shortly" -d p:2:3
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v PP1 /t REG_SZ /d "CMD /C \"rd /s /q %systemroot%\Temp\PostPost\""
Posted by: lindsamw 14 years ago
Orange Senior Belt
0
I did something really similar, except I added an additional file in there. Basically if you put a shutdown command in the runonce, after login, before the desktop loads, windows has to finish running all the runonce commands before it can show a desktop. The shutdown command will prevent anything else from running or being started. So I put a little bootstrap type thing in there so that the desktop would finish loading. My initial batch file makes a runonce, that runonce starts a batch file, that batch file starts a 3rd batch file, and my 3rd batch file sleeps for 120 seconds or what not, then it initiates the shutdown. I end up with 3 batch files basically, but a little better timing control, so I'm not shutting down windows when a bunch of stuff is still being built or loaded.
Posted by: tcasey 14 years ago
Senior Yellow Belt
0
I just created a post install task to execute the shutdown command as the last task to do. I set it to have a time out of 3 min so that the desktop will still load, but once the command is executed and you get the count down to the reboot the KBOX will continue on with whatever is left in the list (e.g. Cleaning Up). I chose 3 min as the timeout based on that was how long it took my oldest machines to get to the desktop of windows xp.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ