Pre-job action: rebooting the computer
I use the following to shutdown as a post-job action:
%WINDIR%\SYSTEM32\SHUTDOWN.EXE /s /t 180 /c "Shutdown in 180 seconds" /d p:4:1
Is it possible to similarly set a pre-job action to restart the computer? Will that interfere with the job running immediately after Windows comes back up?


- Log in to post comments

Thanks, Steve, but I don't understand how you're answering my question. Could you please explain?
- Log in to post comments

Thanks, Steve, so are you saying I would put a batch file like this:
%WINDIR%\SYSTEM32\SHUTDOWN.EXE /r /t 180 /c "Restart in 180 seconds" /d p:4:1
as a pre-action - then using the Advanced Settings, set a delay?
- Log in to post comments

Eliezer, sorry but you cannot use a Pre Command that would perform a reboot as the task will then fail due to shutting down. You should just be able to Schedule the task and allow the computer to go into sleep or hibernation state and wake up to perform the scheduled task per the Advanced settings for this.
- Log in to post comments