To all this that we are commenting on, the energy consumption of desktops, especially when it comes to laptops. Here autonomy is a key element for the proper functioning of our team. In this sense, we can take certain measures such as letting the computer go to sleep, lowering the screen brightness, or not running applications that consume a lot.
We tell you all this because there are many apps that prevent the system goes to sleep if they are busy at that moment. On the other hand, we find some that can even turn off the system once they have completed a certain action they carry out. Although the latter is not too frequent, it does happen. Take as an example what happens with some of the torrent clients, since they usually have this type of feature. We must also target the programs that finish a certain task and continue to run in the background, consuming resources.
Well, whatever our case, below we are going to help you with these applications that can be a problem for him. Microsoft operating system. Specifically, we are going to show you how to close them automatically when we really need it. This will give us more control over the running programs. This way they will work when we really need it, not when the programs themselves establish it or when we have to use the Task Manager to finish them.
How to close apps automatically
The ability to automatically shut down an operating system such as Windows When an application is closed, it is called a sleep timer. As an example, the app for the online music service, Spotify, has one. But the truth is that these types of timers are not very common in the software we use. We have already told you before that we usually find them in the torrent clients, but little else.
With everything and with it, there are several ways to schedule the automatic shutdown of Windows 10, but all of them force the closing of the applications. Therefore, if what we need is for an application to close by itself and for the system to shut down, we will have to create our own shutdown timer. This that we tell you is quite simple and easy to carry out. For this we just need to create a script run in batch to get the job done and add it to a scheduled task.
Create a script to close programs
As we told you, we are going to create our own custom script to close any application automatically and whenever we want. To do this, the first thing we do is open the plain text program that is included in Windows itself, we refer to Notepad. Next, what we do is paste the following text into the blank document that appears on the screen.
taskkill /IM programa.exe
shutdown -s -t 30
Of course, in the text we have to replace programa.exe with the name of the application that we need to close. At the same time we establish the time in seconds on the next line. Finally, we save the file with a .BAT extension. Let’s see a more practical example to give us an idea
taskkill /IM word.exe
shutdown -s -t 30
To give us an idea of what we just did, this particular script closes the Microsoft application that is running. At the same time shut down the operating system 30 seconds after closing the application indicated in the script.
Add a scheduled task to close programs
What we are going to do now is create a new scheduled task in the Microsoft system to run the previously created script. Say that this scheduled task will run the script that was created in the previous section so that we don’t have to run it manually. To do this, the first thing we do is open the Task Scheduler, for example by typing its name in the Windows search box.
Create and configure a scheduled task
Once the window corresponding to the section of the system that we are commenting on appears, we only have to create a new task. We do this from the Action / Create task menu. We assign a name to it that indicates which application will be closed depending on the previously created script.
Next we go to the tab called Triggers, where we add one through the New button located at the bottom of the window. Say this new trigger should be set to On schedule. We must also select the option Once, unless we need to close that application and turn off the system at a defined time every day. In that case, we always have the possibility of using the other programming options in this specific section.
Load script to close programs
Once you have added the activator as we have just mentioned, we go to the tab called Actions and we add a new action. We leave the Action section as it comes by default, that is, in Start a program. Next we select the file with the script to close programs that we have created. Therefore, once this task has been completely created, as we have seen, it will be activated by default in Windows.
In case that let’s set the task to run only once, we’ll need to modify the trigger the next time you need to use the sleep timer. This is the safest way to do it, as we won’t be surprised if we forget that the task is set up and running.
In the same way we have the possibility of modify the script and make it close the application, but leave your system running. Here all we have to do is delete the second line of it. Something that we must take into account is that the script does not save anything that is open in the application, it only closes it.