Scheduling Windows server reboot

Usually reboot can not be done during the business hours, and herefore you would like to have an easy way to do that at night. Here is when an old “at.exe” utility comes into play (I know about SCHTASKS.exe but at.exe is way easier to configure). So, here is a simple command:

at.exe 2:00 shutdown.exe -r -f -c "Planned Reboot" -t 10

Interesting thing about at.exe is that utility in the example interprets 2:00 as 2:00AM. It means that if the time when you run this command is later then 2:00AM Today [normally you are sleeping at that time :)] then utility knows that you are talking about Tomorrow.

But what if you need to schedule reboot later then 24 hours from know? Maximum time that you can enter is 23.59. We need something else, and that is /next:X, where X can be any day of the month: 1, 2, 3, 4, … , 31. So, suppose today is 16th and I want to run the task on the 18th at 1:00AM:

at 1:00 /next:18 shutdown.exe -r -f -c "Planned Reboot" -t 10

If you have made a mistake then just delete the task by using it’s ID and /delete key:

at 1 /delete

or you can delete all task at once:

at /delete
Advertisements

Leave a Comment here

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s