If you have custom batch scripts to run on schedule, follow these steps to schedule batch file in Task Scheduler in Windows.
In Windows, Task Scheduler is one of the most overlooked and even lesser-known applications. However, it is also one of the most useful applications when it comes to Windows automation. You can do so much with just a few clicks.
Though you can do a lot of things directly with the task scheduler, there are also a few things that require you to execute custom scripts. This is especially true for advanced tasks. For example, I wanted to automatically delete files and folders in a given folder after I log into the system. You cannot do that directly with the task scheduler. So, I created a batch script and used the task scheduler to execute that batch file on schedule.
So, if you have task-specific batch scripts that you’d like to execute on schedule then you can do that too. Just follow the below steps to schedule a batch file in Task Scheduler in Windows.
Steps to Schedule Batch File in Task Scheduler
Scheduling a batch file with Task Scheduler is way easier than you think. Just follow the steps shown below and you will be good.
1. First, make sure that you have the batch script ready and stored in a safe place. The location is important because if the file is moved or deleted from that location, the task will not run.
2. Now, open the Start Menu, search for “Task Scheduler” and click on the search result to open the same. Alternatively, you can also use the Run (Win + R) command “taskschd. msc”.
3. After opening the Task Scheduler, click on the “Create Basic Task” option on the rightmost panel.
4. In the new task wizard, name the task descriptively and click “Next”.
5. In the Trigger page, select how the task should start. In my case, I want the task to start as soon as I log into the system. So, I selected the “When I log on” radio option.
6. The Action tab lets you choose what the task should do on the trigger. Since we want to run a batch file on schedule, select the “Start a program” radio option. Click “Next”.
7. We now need to select the batch to run. To do that, click on the “Browse” button. In the window, go to the folder where you’ve stored the batch file, select it and click on the “Open” button. This will add it to the task scheduler. Click “Next”.
8. Click the “Finish” button to complete the task creation process.
That is it. From now on, the batch file will run as scheduled.
Run with Admin Rights
If the batch file needs administrative privileges, you need to follow a couple more steps.
First, find the task in the Task Scheduler. Next, right-click on it and select the “Properties” option.
In the properties window, go to the “General” tab and select the “Run with highest privileges” checkbox and click on the “Ok” button. You will be prompted to enter the admin password. Type the admin password, click on the “Ok” button and you are done.
I hope that helps. If you are stuck or need some help, comment below and I will try to help as much as possible. If you like this article, do check out how to back up all scheduled tasks in Windows. This is very useful when you have custom scheduled tasks.