How to Auto Shutdown a Computer at Specific Time without Applications

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”

  1. Open “Task Scheduler”. Type a task scheduler in the search feature.
task scheduler01
  1. Select “Create Basic Task”. This option is in the actions column in the rightmost column.
task scheduler02
  1. Complete the Basic Task Wizard. Give it a name that’s easy to remember, like “Bedtime”. Then click the Next button.
task scheduler03
  1. 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.
task scheduler04
  1. Set a clock. Set the clock to turn off the computer automatically. Then click Next.
task scheduler05
  1. Select “Start Program”. Then click Next.
task scheduler06
  1. Select the location of the program/script. Click the browse button and select the program location in“C:\WindowsSystem32shutdown.exe”. Add in the arguments column“/s”. Then click Next.
task scheduler07
  1. 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.
task scheduler08

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.

  1. 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 😡
)
  1. 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”.
task scheduler script
  1. Then repeat in step 4 of the previous way. This time select “When the computer starts”. Then follow the next step (step 6).
task scheduler09
  1. 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:\DocumentsshutdownTimer.bat”. Then click Next. Next finish.
task scheduler10

Latest Articles