Introduction: How to Make a Batch File That File Shutdown a Computer Every Half Hour of Every Day

In this instructable I am going to show you how to make a batch file that will shutdown a computer every half hour of every day. I also included an small tutorial on how to use the AT command.

This was posted for educational purposes only, I am not to be held responcible for any inappropriate usage of this information or the files that I may have provided. I am not to be held responsible for individuals or groups of people that suffer consequences of using this information or the files that I provided, these consequences include things such as expulsion, getting fired, or legal action.

Step 1: Lets Begin

Alright, lets begin. First open notepad and copy this script:

at 0:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 0:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 1:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 1:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 2:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 2:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 3:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 3:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 4:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 4:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 5:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 5:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 6:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 6:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 7:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 7:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 8:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 8:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 9:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 9:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 10:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 10:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 11:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 11:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 12:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 12:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 13:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 13:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 14:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 14:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 15:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 15:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 16:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 16:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 17:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 17:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 18:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 18:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 19:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 19:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 20:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 20:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 21:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 21:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 22:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 22:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 23:00 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 23:30 every:m,t,w,th,f,sa,s shutdown -s -t 5
at 24:00 every:m,t,w,th,f,sa,s shutdown -s -t 5

Then save this as a batch file, for those of you who do not know how to do this, just type .bat at the end of the file name when your saving it.

Step 2: Explanation and Execution

Alright, I will start out with the beggining of the code line which is AT.

the "shutdown -s -t 5" runs the shutdown.exe with the parameters of shutting down the computer with a count down of 5 seconds which can be changed to 00 for immediate shutdown with no dialog box. -r is restart and -l is log off

The AT command schedules commands and programs to run on a computer at a specified time and date. The scheduled service must be running to use the AT command.

Next is the time

The selected time must be entered in military hours, we made a different line for every half hour.

Then there is the every:m,t,w,th,f,sa,s

The every: command specifys which days or day to run the script or program.

Now for the end

The shutdown -s -t 5 is the code that we are running at the specified times and days.

Note:
You can instead of using every: type a date, and you can use and program .exe .bat or script or anything in place of the shutdown code, we are using shutdown because thats what this instructable was made to show, but I decided to include an explanation.




Now then in order to use the file that we made you can just open it, or put it into someones startup folder for fun.