Batch files are typically used to automate repetitive tasks in Windows computers, and the ability to schedule those tasks to run at designated times make it a powerful productivity tool. Today, we will learn how to schedule batch files in Windows 10 using the built-in Task Scheduler utility. Even if you’re not an advanced user, the simple instructions will help you create batch files to run commands on a schedule to help to automate tedious tasks on your PC.
This tutorial will show you not only how to schedule batch files to run automatically in Windows 10, but also tell you about what it is and how it helps advanced users automate tasks in Windows computers. We will also teach you how to make a batch file on Windows 10. So without further ado, let’s look at what a batch file is and how to use them to execute commands on a schedule in Windows using Task Scheduler.
- What are Batch Files?
- What Can I Do With Scheduled Batch Files?
- What Special Apps Do I Need to Create Batch Files?
- How to Make a Batch File in Windows 10?
- How to Schedule Batch Files
What is a Batch File?
Batch Files in Windows are script files, typically with a .bat extension, capable of running a series of commands in the Command Prompt in a specified sequence and according to triggers defined by the user. You can make a batch file to run just about any Command Prompt command, either manually or on a schedule.
What Can I Do With Scheduled Batch Files?
As mentioned already, batch files help you automate repetitive tasks in Windows. You can use it to modify system settings, open up specific programs at specific times, launch multiple apps on a schedule, automate system backups and more. All supported versions of Windows (server and client) have a set of built-in Win32 console commands that you can use to automate tasks by using scripts or scripting tools. You can use either the Windows PowerShell, Windows Commands or Windows Script Host for automation.
You don’t need source code editors or fancy IDEs to write BAT files in Windows. All you need is the good old Notepad, because a barebones text editor is all you need create a batch file in Windows.
To start off, let’s write a simple batch file that will open multiple programs simultaneously at startup every time. I use Firefox every day for my surfing needs and Outlook to check my mails. So we’ll create a batch file to call the executable for both those programs that we want to open. For that, do the following:
This will tell your computer not to give you any messages or popups while executing the commands in the batch file.
start “Firefox” “C:\Program Files\Mozilla Firefox\Firefox.exe” start “Outlook” “C:\Program Files\Microsoft Office\root\Office16\Outlook.exe”
- You can save it under any name. I’m using “demo.bat” because this is a batch file created for demonstration purposes. Most importantly, make sure to change the file type to ‘All Files’ (.) instead of ‘Text Documents’ (*.txt).
Now that we’ve been learnt how to create batch files, we will shift our attention to the (relatively) easier part where we set it to run on a schedule. In our case, we will set this file to run at Windows logon every time. To do this, we’ll use the built-in Windows Task Scheduler, which is an utility that lets users specify triggers to launch programs or scripts at pre-defined times or at specified time intervals.
Note: You can also opt for more granular controls over the scheduling time, triggers and conditions by choosing ‘Create Task’ instead of ‘Create Basic Task‘.
- Finally, click on ‘Finish’ on the next screen to create the task.