Using the shutdown command to shut down a computer after a specific time
To enter a command, you need to press the Win + R keys and enter the following in the input field that appears on the screen:
shutdown –s –t 3600 /f
Where the variables after the command are responsible for the following:
- s – turn off the computer;
- t – indication of the time in seconds after which the device will be turned off. In the command from above it is 3600 seconds, that is, one hour. Instead of this value, you can substitute any other value, having previously calculated it in seconds;
- f – the first letter of the word forced – forcibly. Allows the OS to terminate all running applications so that they do not interfere with the device shutdown.
After executing the command, a notification will be displayed on the screen indicating the time after which the PC will be turned off. If you suddenly need to cancel this operation, you need to enter Win+R again and type the following command there:
shutdown –a
This command disables the computer turning off at a specific time.
How to set up a scheduled computer shutdown in Windows!
Some users need to configure the computer to turn off by time or even on scheduled days at certain times. The reasons can be different and the most banal one is that you already start watching some movie at night and don’t want the computer to work until the morning if you suddenly fall asleep. The same function is used by some on TVs and all for the same reason.
And the most interesting thing is that such a function in a computer is far from lying on the surface. It seems like a computer is such an omnipotent device, but such a banal function is hidden somewhere that a beginner will never find it!
So, from this article you will learn how, using a simple command in the Windows console, you can configure the computer to turn off after a certain number of seconds, as well as how to configure the computer to turn off at a certain time on certain days!
Beginners should not be intimidated by the words “Console”, “Command Line” and the like, since we are not talking about programming and other complex tasks! I will show you an example and you will understand everything...
So, now we will look at 2 ways to turn off the computer on time:
- Simple shutdown of the computer after a specified number of seconds;
- Turn off the computer on a specified day and time.
How to set a timer to turn off the computer?
To implement this task, we only need the Windows command line.
In any operating system, you can quickly find the command line through a search. For example, in Windows XP, Windows Vista or Windows 7, open the Start menu and type “cmd” in the search box at the bottom. The Command Prompt application appears in the list.
If you have Windows 8, then also open “Start”, then click on the search icon on the right:
In the field that appears, type “cmd” and the Command Prompt program will immediately appear in the search results:
And finally, if you have Microsoft's latest Windows 10, the default search icon will be located right next to the Start button. Click it, enter “cmd” and see the “Command Line” application:
To complete our task, you may need administrator rights, and therefore, in order not to later have to look for the reason why shutdown by timer may not work, let’s run the command line as an administrator. To do this, right-click on the program icon and select “Run as administrator”:
You should see a black command line window that looks like this:
Please note that if in this window instead of the path “C:\Windows\system32” the path to the user’s folder is specified (for example, “C:\Users\Ivan”), then you did not run the command line as an administrator, but from an ordinary user! In this case, it is better to close it and open it again as an administrator.
After the command line has been launched, all that remains is to enter one command correctly and you’re done!
To shut down and restart your computer, use the “shutdown” command in the Windows command line.
Type the following on the command line:
shutdown /s /t 3600
Where 3600 is the number of seconds after which your computer will shut down. If you press the “Enter” button on your keyboard now, your computer will be turned off in 1 hour, since one hour is exactly 3600 seconds. It’s very easy to calculate . We know that there are 60 seconds in one minute, and since there are also 60 minutes in an hour, we multiply 60 by 60 and get 3600. For example, 1 hour 20 minutes is 4800 seconds.
Now regarding these characters “/s” and “/t”.
These are the 2 parameters that I specified for the shutdown command. The “/s” parameter means that the computer should shut down, and not reboot or simply log out. For example, to reboot you need to specify “/r” instead of “/s”. The “/t” parameter allows you to set the time before the command is executed. For example, if we specified the command without “/t”, i.e. like this “shutdown /s”, then the computer would turn off instantly.
Now, I think you understand everything. Just enter your time until you turn off your computer and press “Enter”!
The command line window will close and the timing will immediately begin. You will receive a warning message, for example:
A warning of this format is issued when there are only a few minutes left before the computer turns off.
But if you have set a long timer, for example, for an hour or more, then when it starts, you will simply receive a notification in the system area:
If you suddenly decide to cancel the timer, then you need to enter the command line again and run the following command there and press “Enter”:
Shutdown/a
At the same time, you will receive a notification in the system area that the scheduled shutdown has been cancelled:
This is what a simple scheme for turning off a computer using a timer looks like.
Now let's look at a more interesting option - how to delay turning off the computer for a certain day and specified time.
How to configure the computer to turn off on the desired day and time?
To implement this feature, we need the system utility “Task Scheduler” and “Notepad”.
Through the Windows Task Scheduler, you can schedule the execution of any program on a specific day and time, and even set a recurring task for different periods, for example, daily, weekly.
There is only one catch: you won’t be able to open the command line through the scheduler, as was done in the method described above, and enter a shutdown command there. This is because to run we need some kind of file that can be specified in the scheduler and which will contain a command to turn off the computer.
This issue can be resolved very simply! You need to open notepad, write “shutdown /s /t 000” there, save the text document to a file with the extension “.bat” (for example, “Shutdown.bat”), and then point to this file in the task scheduler.
Now let’s look at it in detail, point by point:
- Open Windows Notepad. It is available by default in any Windows system and can be found in the “Start” menu, in the “Accessories” category, or by searching Windows and typing “Notepad”.
- In notepad we write: shutdown /s /t 000.
Here, using the “shutdown” command, we specified the action to shut down/restart the computer or log out of the system.
With the “/s” parameter we specify the action - shutdown the PC!
With the “/t” parameter we specify the timer before shutdown - 0 seconds and this means that the computer will turn off instantly without delay.
This is how it should look:
- Resave the notepad file into a file with the extension “.bat”. To do this, in Notepad, click “File” > “Save As”.
In the save window, indicate the location where the file with the command to turn off the computer will be stored, after which we indicate any file name, but make sure there is “.bat” at the end and not “.txt”:
For example, like mine - “Shutdown.bat”. The name before “.bat” can be anything!
And click the “Save” button.
If you saved the file correctly, it will look like this on the system:
If it looks like a regular text document, then you most likely forgot to specify the ".bat" extension when saving, so please do this step again.
What kind of BAT file is this? A file with the “.bat” extension allows you to execute Windows commands one after another, as well as various scripts. In our case, only one command is written - turn off the computer immediately.
- Open the task scheduler and configure the launch of the created Bat file.
The task scheduler is also built into all Windows systems by default and can be found by searching or through the control panel: “Control Panel” > “System and Security” > “Administrative Tools”.
This is what the task scheduler looks like:
In it on the right, in the “Actions” window, open the “Create a simple task” item:
The wizard for setting up the scheduled task will open, where you need to go through several steps. In the first window that appears, enter the name of the task, for example, “Turn off the computer” and click “Next”:
At the next step, you need to note when the planned task will be executed? It depends on when you want to turn off your computer. For example, you can configure a task to run daily and then you will need to specify the execution time. You can set up a weekly shutdown and then you can select specific days and times to complete the task.
And if you just want to set up a one-time setup to turn off the computer on a certain day and time, then select the “One time” option.
Having made your choice, click “Next”:
Now, depending on which shutdown period you set in the previous step, you will need to specify the shutdown month/days/time. If you specified a one-time execution of the task (“One time”), then you only need to select the shutdown day and time.
You can enter the date manually using numbers or select it using a calendar.
Having configured the shutdown date and time, click on the “Next” button:
At the next stage, we select an action for the task. Oh and click “Next”:
In the next window, select our created file with the extension “.bat”, which contains the shutdown command. Click on the “Browse” button and select this file on your hard drive, then click “Next”:
In the last window, select the item marked in the image below and click “Finish”:
This option means that after clicking “Finish”, an additional properties window for the created task will open. We need this to enable the program to run with administrator rights.
A window will open in which, on the first “General” tab, check the “Run with highest rights” item at the bottom and click “OK”:
All! The scheduled task has been created. Now, as soon as the date and time you specified arrives, the computer will immediately turn off.
If you suddenly want to change any parameters of a scheduled task, then open the task scheduler again, select “Task Scheduler Library” on the left side of the window, right-click on the task you created in the list in the center, and select “Properties” from the menu that opens :
A window will open where, on several tabs, you can change all the parameters that you configured!
In this way, you can configure the computer to turn off by time (timer), as well as schedule the shutdown for any day and time, and even set up the task to be performed regularly. I am sure that this opportunity may be useful to someone.
See you in the next articles
Using the Task Scheduler
This program comes in versions of Windows 7 and higher. It allows you to quickly create a PC shutdown schedule.
To call and configure the scheduler you need:
- click on the “Start” button;
- In the search bar, type the command taskschd.msc and click the “Ok” button. This command opens the scheduler;
- switch to the “Action” tab, which is located at the top left;
- click on the “Create a simple task” button;
- in the window that appears after, type any process name, for example, “Shut down the computer at a certain time.” Then you need to click the “Next” button located below.
- then you are asked to select a time to turn off the PC and press the “Next” button again;
- in the “Action” tab, select “Run the program”, then click “Next”;
- A line called “Program and Script” will appear. You need to write the following in it:
C:\Windows\System32\shutdown.exe
And in the argument selection field the following is entered:
/s
Then you need to click on “Next” again. Before clicking on the “Finish” button, it is better to review everything again so as not to miss any parameter or correct the one already entered.
Software timers to automatically turn off your computer
There are many applications that allow you to configure automatic shutdown of your computer through a graphical interface familiar to the user.
Power Off!
At first glance, the interface seems complex and overloaded. In reality, you just need to “make friends” with him. The utility offers several sections.
Timers . This is where you set options for shutting down, rebooting, or entering standby/sleep mode.
In the “Standard Timer” block, you can configure the computer to turn off at a certain time, either upon completion of the countdown (set by the user), or after a specified time of OS inactivity.
Winamp's dependent timer . The software is tied to the popular media player Winamp. The operation of the utility can be controlled from the player. For example, you can set the system to turn off after playing a certain number of songs or after finishing playing the last position in a playlist. This feature will appeal to those who like to fall asleep to music (see Why there is no sound on a computer or laptop).
CPU dependent timer . The application adapts to the state of the processor. For example, the utility can be configured to shut down the system if the processor load exceeds the permissible load (see How to choose the best processor) for a certain period of time.
Internet dependent timer . The function will be useful for users who regularly download large files from the network. The software can be configured to shut down / activate sleep mode after downloading files, etc.
Other functions . The utility has a customizable diary and other useful features.
Time PC
The program can be configured to put the computer into hibernation mode and then wake it up according to a schedule. The built-in scheduler is designed for weekly use. There is a function to launch the application along with Windows (see How to disable autorun of Windows programs).
Hibernation can be compared to “lethargic sleep.” Unlike sleep mode, during hibernation the main system processes are completed (even coolers stop making noise) and the computer appears as if it is completely turned off.
Before entering hibernation mode, system state information is saved. After waking up, all processes are restored.
Important! For hibernation mode to work, you must first activate S3 mode in the BIOS settings (see How to enter BIOS on computers and laptops).
Before using the utility, find the power management section in the Control Panel, open the sleep mode settings and enable the use of wake timers. Otherwise, the application will not be able to wake up the system on a schedule.
Sleep Timer 2007
The program, modest in its functionality, will take up minimal space on your hard drive and will not require prior installation. The application can do the following:
turn off/reboot/sleep the computer at the specified time;
forcefully terminate user-selected processes;
gradually reduce the volume;
launch a user program via a shortcut.
OFF Timer
Another representative of the category of elementary programs from the “nothing extra” category. There is only one function: turn off the computer at a time specified by the user.
All running programs will be forcibly closed (see What programs are needed for your computer).
Before the system shuts down, the program will issue a corresponding notification. The user will have 10 seconds to cancel the upcoming event.
The program does not require installation.
SM Timer
A miniature utility with two main functions:
1. turning off the computer at a specified time;
2. ending the session after a certain period of time.
The time is set using sliders - the only decoration of the modest minimalist interface.
Now you know how to set Windows 10 to shut down via the command line, task scheduler, and popular third-party programs. Choose the option you like, follow the appropriate instructions and everything will work out.
Using a bat file to shutdown a PC
You can also use a bat file to shut down your PC. To activate it, just double-click on it with the mouse.
You will need to create it. This is done in a notepad, where the following values are entered:
@echo off
:a
if %time%==01:00:00.00 goto :b
go :a
:b
shutdown.exe /s /f /t 60 /c “Any text that the user deems necessary”
- the file that was created must be saved, giving it the name shutdown.bat;
- you need to activate it by clicking;
- after activation, a command line will pop up, which you need to minimize and continue working;
- At the time that was set (in the example, one in the morning is used), the system will issue a notification to turn off the device and the PC will be deactivated;
- To change the shutdown time, you need to enter another value instead of the numbers “01:00:00.00”.
Turning off the PC at a specified time using programs
Some special programs can also help you configure the device to turn off on a schedule.
Using PC Auto Shutdown
This utility allows you to shut down your PC at a specified time. To use it, you need to download the installation file from the official website, install, run and do the following:
- find the Timer title line, where you need to enter the name of the action, and also select the Shutdown action function;
- indicate the time;
- At the bottom of the window, check the Activate daily at the above time item and click the “Ok” button.
Using Wise Auto Shutdown
A more advanced utility, thanks to which you can configure many parameters for deferred PC management. You can also arrange for these operations to be performed on a regular basis. The program issues a warning about turning off the device 5 minutes before the computer turns off.
To begin with, in the application window you need to select a task, the frequency of its execution (daily - every day, from now - starting from this moment, on idle - when the system is idle) or activation only once (specified time).
Other programs for scheduled computer shutdown
Other utilities can help you turn off your computer on a schedule.
There are quite a few of them and they all have similar functionality, so each user will be able to choose an option for themselves and easily understand it. Share.
More on the topic:
- How to take care of your eyes while working at the computer? Statistics show that more than half of people suffer from vision problems. Increasingly, we are struggling with myopia, dry eyes and so-called foggy vision. One of the main […]
- How to quickly restore drivers on a computer In our fast-paced times, a computer has come into every home, and now every child whose main hobbies are toys already knows what an operating system is and […]
- How to quickly turn off the computer screen It happens when you urgently need to leave for important matters, you have to leave the computer open. At such moments there is always a risk that some ill-wisher will receive [...]
- How to clean the keyboard on a laptop? Very few of us regularly clean our laptop keyboards, and believe it or not, there are people who almost never clean their computer keyboards in their lives. Unfortunately, the lack [...]
- Best Extensions for Google Chrome Chrome has several interesting options that will make your browser a great tool for your work. Extensions are small plugins that add certain functionality, access to [...]
Shutting down the computer after downloading a torrent
Another way is to use application programs that already have this function in their settings. One such program is a torrent client. Many people download at night when download speeds are faster, but why leave the computer on all night?
And here our batch file will come in handy again, but we do it not for rebooting, but for turning off the computer by setting the required parameter. We will not include it in the task scheduler, but will include it in the “Properties” of the specific torrent being downloaded. After starting to download the torrent, you need to go to its “properties”
By default, the file selection settings are exe; but we indicate “All files” and then “Explorer” will see our body file:
In the “settings” of the torrent client you can find ready-made settings for turning off the computer or putting it into sleep mode. You can use them when you have a lot of active downloads in your torrent:
That's probably all. Many programs have their own settings; often there is simply a checkbox called “Turn off when finished.” Use it, all the best to you!
Author of the publication
offline for 5 days