Regarding the use of the PC, one of the most frequent questions I am asked concerns the possibility of turning off the PC at a certain time. It is not the first time that I have to respond to this request, and I have therefore decided that the time has come to put my answer on paper.
If you clicked on this guide of mine, it probably means that you are among those people who have asked themselves this question and asked me: “Salvatore, how do you turn off the PC at a certain time?“. Well, since you also need an answer, know that I am more than happy to give you a hand.
For once I must admit contrary to how I always say when I introduce the topic of my tutorials, this procedure is not so simple. Or rather; There are several ways to do it and, during this guide I will tell you about the most difficult ways (do not worry, I will guide you step by step), but also the easiest ones. You will see, I am sure that, if you pay attention to the procedures that I will show you, you will not be able to go wrong. I wish you a good read.
Are you looking for a program to turn off your PC at a certain time? What I found easier to use though is Wise Auto Shutdown. This free program has a minimal interface with everything it can do for you. If you are interested in downloading it, you can connect to the official website and then click the green Free download button.
After downloading the program, double-click on it and then click the Yes button at the end of User Account Control. In the installation window, click I accept the terms of the license agreement, click the Next button twice, and then click Install and Finish.
When the program starts, you will be prompted again to press Yes in the User Account Control window, to give privileges (to be assigned each time the program starts) to perform scheduled shutdown operations.
From the interface, then select the Power Off item and then, from the left bar, select when you want to perform the shutdown. You can run it for a specific date (At a specified date and time), starting then with a countdown (From Now), daily (Daily), or if your PC goes into idle (During Inactivity). Then click the green Enable button and then Yes, followed by Ok to confirm the shutdown schedule.
If you want to use an alternative method for automatically shutting down your PC that does not require you to install any programs, you can opt to run a script to use with your Windows task scheduler.
I inform you that with this method you will not have to install any program but use the features of your Windows operating system. In addition, I advise you to carefully follow each step that I will illustrate to you, to avoid failing in your intent. Although this process may be more difficult for inexperienced users, I am sure that, if you follow the steps I will explain to the letter, you will be able to do everything correctly.
I remind you that the methods I am about to recommend are valid both for PCs with Windows 11 operating system and those with Windows 10 operating system (or even earlier).
The first thing you need to know is that, performing a shutdown of a Windows PC is possible through the shutdown command. However, arguments must be associated with this command. There are different types of topics to associate with shutdowns, but in this guide, I will tell you specifically about those that serve your purpose. I will list below the ones you could use:
- –s: it is the command for shutting down your PC; the shutdown does not happen immediately, but it takes about a minute, giving the user, if necessary, time to interrupt the shutdown procedure.
- –p: shuts down your PC immediately, without any warning.
- –t xxx: This command binds to the -s parameter to further delay the PC shutdown. The –t parameter is followed by a space and then a number expressed in seconds: for example, if you want to turn off the PC after 10 minutes from the execution of the command, you will have to enter -t 600. You can easily calculate the number of seconds, multiplying the value 60 by the number of minutes, in this case 10×60. Accepted values range from 0 to 315360000 (10 years).
- –f: is the parameter to force the closure of running programs. It will have happened to you that, when you perform the manual shutdown, a Windows screen appears that shows you the programs or applications that are preventing the shutdown; Windows will then suggest you wait (but for some programs it is not really stopped) or to force close, using the appropriate button.
- -a: this is finally the lifesaver parameter in case you have performed a script shutdown and want to stop it; you will then have to open the Command Prompt and type shutdown -a in it to block the countdown.
However, there are other parameters to associate with the shutdown command. I therefore advise you to open the Command Prompt by looking for it in the Start menu and simply type the term shutdown: you will be able to see the list of all the parameters that can be used.
Once you have clarity on the subject, it is time to act and automate PC shutdown using Windows Task Scheduler.
To do this, look for Task Scheduler in the Start menu and click on the corresponding search term, to open the Windows feature.
From the right sidebar, click on the Create basic task item to launch a window that will help you set up the scheduled process. Enter the name of the scheduled job in the Name field, such as Scheduled Shutdown, and then enter a description.
Then click Next and select how often you want to run the script from the options that will be proposed to you (Daily, Every week, Every month, once only).
Once you have made your choice of frequency, click Next and set the day and time when the script will start for the first time. The script will then run at the frequency indicated at the time you set. You can also add additional information, such as if you chose Every Week, you could select which days of the week to run the script and which not. Then confirm your choice by clicking Next.
Then check the Start Program box and click the Next button. Within the Program or script text field, you will have to type (or copy and paste) the string %SystemRoot%\system32\shutdown.exe and, in the Add topics field, you will have to enter the topics I told you about in the previous chapter.
If you want, for example, to turn off your PC, forcing the closure of programs and delaying everything by 10 minutes, you will have to write -s -f -t 600 and then press, to confirm, the Next button. Choose the combination that is right for you, according to your needs. Then verify that the information on the screen is accurate and then click Done.
You will then have to wait for the day and time indicated for the first execution of the automatic shutdown. However, you can evaluate if you have done everything correctly, looking for the task you have just created and right-clicking on it, followed by a click on the Run item.
If you have set a delayed shutdown (-t xxx) then you can stop everything by opening Command Prompt and writing shutdown -a.
Notwithstanding what has been said so far about the shutdown command and the creation of a task that automates the shutdown, you can also create a script file, with a .BAT extension, to be run by the Windows Task Scheduler.
The first step to do this is to open Windows Notepad, which you can find in Start. After opening the program, you will have to type the shutdown command, followed by the arguments that serve your purpose. For example, you can use the shutdown -s -f command which, as will be clear to you by now, will allow you to perform a shutdown of the PC, forcing the closure of any programs that may be open.
After typing it, click the File > Save As button at the top. Then choose the folder where to save your file and, in the File Name field, type the name you want to give to the script, followed by the BAT extension. For the development of this tutorial, I will therefore call the script shut down.bat, just as an example.
Now start the Windows Task Scheduler, which I told you about in the previous paragraph, and follow the instructions I provided. In this case, however, when you have reached the point where you need to fill in the Program or script field, you will have to click on the Browse button and select the file with the extension BAT, previously created. You do not have to fill in the Add Topics field.
What I have just explained to you is an alternative method that does not exclude the one I explained earlier. In practice it is a way to do the same thing, but with a different procedure.
Referring to the command I indicated before (shutdown), you can also avoid scheduling the shutdown through the Windows Task Scheduler tool. Alternatively, you can simply create a shortcut on the Desktop to run and modify the command to your liking.
To do this, right-click on the Desktop and select the New > Shortcut items from the context menu. In the field Enter the path to the link you will have to type the shutdown command followed by the parameters that I have previously indicated. Then type for example shutdown -s -f -t 3600 which indicates the shutdown after 1 hour from the execution of the script.
Then click Next and enter the name of the link to your liking. In this case I will write Power off 1 hour and then click Done.
What is next? If you double-click on that link, a window will appear informing you of the start of the shutdown process at the time indicated on the screen.
You can then create many links according to your needs or modify the one in use, right-clicking on it and selecting the Properties item. In the Destination field you will then have to change the parameters of the command, perhaps changing only the number with a larger or smaller one, according to your needs. When you are done, you will need to click Ok to save the change and then run the script by double-clicking on the link.
Are you going to figure out how to automatically shut down your Mac at a certain time? Then look at the next lines, I will quickly explain how to do it.
First, go to the System Preferences, going to click on the apple icon at the top left. At this point, click on the Battery item at the bottom.
From the menu on the left, all you must do is select the Program section, to have access to a series of options for starting or shutting down your Mac.
Press the box next to the Stop button to start setting an automatic shutdown time. Click the drop-down menu set to Stop by default to choose whether to put your Mac to sleep, shut it down, or restart it.
Choosing the option you prefer, select how many times the Mac should repeat the operation, through the drop-down menu set by default to Every Day. You can choose whether to activate the option on weekends, weekdays, or for individual days of the week.
You just must set the time at which the Mac should perform the restart or shutdown operation. You can move between hours and minutes with a click of the mouse, then increase or decrease the time through the appropriate arrows on the right, or by typing it on the keyboard.
At this point, click on the Apply button, in order to activate the function. To turn it off, you can simply uncheck the tick you selected earlier.
The Schedule startup and shutdown section of your Mac also allows you to activate the automatic startup at a certain time, in a similar way to that for the shutdown. To configure this option, select the appropriate check (located above the shutdown check) and proceed as above.