Often when we do activities until late at night, we forget to turn off the computer/laptop, to make it turn on overnight.
Or maybe you want to limit the use of a computer/laptop at certain hours. You should not play computer/laptop during study hours or bedtime.
Many applications can do this task. But actually Windows itself also has that capability without the need for additional applications. Well, this time Bardimin will give you how to create an auto shutdown in Windows.
Auto Shutdown through “Task Scheduler”
- Open “Task Scheduler”. Type a task scheduler in the search feature.
- Select “Create Basic Task”. This option is in the actions column in the rightmost column.
- Complete the Basic Task Wizard. Give it a name that’s easy to remember, like “Bedtime”. Then click the Next button.
- Determine the frequency. Determine the frequency of the task you are creating. In the example we want to turn off the computer automatically every day. Then click Next.
- Set a clock. Set the clock to turn off the computer automatically. Then click Next.
- Select “Start Program”. Then click Next.
- Select the location of the program/script. Click the browse button and select the program location in“C:\Windows\System32\shutdown.exe”. Add in the arguments column“/s”. Then click Next.
- Check the settings. Review the settings you have made, if you want to change them you can do it by clicking the Back button and when it is appropriate click the Finish button.
Auto Shutdown with Script
If we want to limit the use of computers at a certain time span it will be easier if we use scripts. For example, you want to ban the use of computers during study hours. For example, you determine the study hours are 18:00 to 21:00.
- Open Notepad. Copy the following code in notepad.
@echo off ::created by bardimin.com ::script to prevent computer usage within a certain time ::start time to shutdown set start=14:44 ::end time to shutdown set end=14:50 set /a min=%start:~0.2%*60+%start:~3.2% set /a max=%end:~0.2%*60+%end:~3.2% 😡 set /a current=%time:~0.2%*60+%time:~3.2% if %current% geq %min% ( if %current% leq %max% ( shutdown.exe /s /f /t 60 /c "Learning Time!!!!!!" ) else ( @timeout /t 60 /nobreak > nul goto 😡 )
- Save the file.
To save it select Save as > File.
In the dialog box File names fill “shutdownTimer.bat“. Note the file must end in “.bat”.
- Then repeat in step 4 of the previous way. This time select “When the computer starts”. Then follow the next step (step 6).
- Specify the location of the program/script. Click the browse button and select the location where the“shutdownTimer.bat” file you saved, for example you save on “D:\Documents\shutdownTimer.bat”. Then click Next. Next finish.