logo
Windows 10 Schedule a Batch File to Run Automatically in Windows 10/11

Schedule a Batch File to Run Automatically in Windows 10/11

By Hally | Last Updated

Task Scheduler can trigger a batch file to run at a specific time or when a specified event occurs, and we can also get a number of configurable options to define how the file will run. In this article, I will show you the most efficient way to schedule batch files to run automatically in windows 10/11.

schedule a batch file to run automatically in windows 10 11

1: Create a batch file

Step 1: Write a simple batch file that will open multiple programs at the same time each time we start. For example, I use chrome and Internet Explorer every day for my surfing needs. Therefore, we can create a batch file to call the executable file for the program we want to open. Open your Notepad, copy and paste the following codes. Each time the files are executed, they will launch both Chrome and Internet Explorer. Click File > Save As, this will pop up a dialog box.

@echo off

start "Chrome" "C:\Program Files\Google\Chrome\Application\chrome.exe"
start "Internet Explorer" "C:\Program Files\Internet Explorer\iexplore.exe"
    

enter the code in notepad

The above command has three basic elements.

The first is the Start command, which is used in the batch file to open the program.

Next is the name of the app -- Chrome, Internet Explorer. This is just for your convenience, so you can use any name you want without affecting the final result.

Finally, it is the installation path of the app. It will be determined by where the target app is installed. In my case, both are installed in "C:\Program Files\". For 32-bit applications, the default location is "C:\Program Files (x86)\".

Step 2: Rename the File name and change its file extension to .bat format, then set the Save as type to All Files, and finally click Save to complete the changes.

rename and save the file

2: Schedule batch files using task scheduler

Step 1: Type Task Scheduler in the search bar and click Open.

Step 2: Click Action and select Create Basic Task.

create basic task

Note: We can also select Create Task to choose more granular controls for scheduling times, triggers, and conditions.

Step 3: Enter the desired name for your task. Then click Next.

enter name and click next

Step 4: A trigger needs to be selected. This will determine when the batch file is executed. If we want it to run every time we log in, then select "When I log on". Finally click Next.

choose when i log on

Step 5: In the left panel, select the Action section. In this article, we want to run a batch file automatically, so select Start a program. Click Next to continue.

start a program

Step 6: Click the Browse button and locate the target batch file. In this article, we saved the batch file on the desktop, so the full path is: C: Users\username\Desktop\open-chrome-and-internet-explorer.bat". Then, click Next at the bottom.

browse the batch file

Step 7: Finally click Finish to create the task.

click finish

Step 8: Now that we have created a task, we have to make sure that it runs with the highest privileges. Since we have UAC settings, we have to make sure that when you run the file, it should not fail if the UAC settings are not bypassed. Therefore, click on the Task Scheduler Library in the left panel, and then double click to open the task you just created.

open the task you just created

Step 9: Under Security options, select Run with highest privileges and click OK to save the changes. We have successfully created a scheduled task to automate the processing of batch files.

click run with highest privileges

Related Articles: