Scheduling apps for Windows 10 aren’t rare. You’ll find quite a few options are available if you’re looking to automate something but in most cases, the task scheduler will still outshine them. If you need to terminate or close, or quit an app on your Windows 10 PC at a given time, you can do so with task scheduler and a simple batch script. Here’s how.
Need to schedule wallpaper change or take periodic screenshots? Dedicated apps are better in that case.
Create batch script
We need to first create the batch script that will run and close the app. You can use a single script to close multiple apps but if the apps need to be closed at different times, then you need to create a different script for each app. Likewise, you will also need to create a separate task to quit each app.
Open Notepad, and enter the following. Replace ‘app.exe’ with the name of the EXE of the app you want to quit. Add a second line for a second app.
TASKKILL /F /IM app.exe
TASKKILL /F /IM firefox.exe
Save the file with the BAT extension.
Create scheduled task
Open Task Scheduler, and create a new task. Go to the Triggers tab and add a new trigger. Set the time and date, or whatever schedule you need for quitting the app.
Next, go to the Actions tab and add a new action. Click the Browse button and select the script that you created in the previous step. That’s all you need to do. Click OK, and you’re done with the task. It will be enabled by default and when the time triggers it, it will close the app that you specified in the script.
If the app is not running, nothing will happen. The task will still run, and it will, in turn, run the script. The script won’t be able to find the EXE in the list of running processes and it will do nothing. It won’t go into a loop and continue to run until it finds the process to quit.
If you specified multiple kill commands in the script, and not all apps in the script are running, the script will still quit the ones that are running.
Remember that for apps that need to be quit at the same time, a single task, and a single batch script will do the job. For each different time that you need to quit an app or apps, you need to create a separate task and a separate batch file.