If you lot're not automating things, you're missing out on the point of computers. The existent purpose of computers is to do ho-hum, repetitive things humans don't want to do anymore.

Batch files are 1 of the all-time ways to automate tasks. Add on to that the ability to schedule those batch files and you've got a powerful productivity tool.

Scheduling Batch Files in Windows Using Chore Scheduler

Later on you brand a batch file to automate a job, you'll want information technology to run regularly. The easiest way to practice that is with the Task Scheduler built into Windows. It'due south a tool that automatically runs jobs on a schedule.

  1. Select the Windows Offset push button and blazon scheduler. The tiptop result should exist Windows Job Scheduler.

Chore Scheduler will have many scheduled tasks already. Windows and programs use scheduled tasks, too.

  1. Make a new folder for your tasks so you don't lose information technology amongst the other tasks already here. Right-click on Task Scheduler Library and select New Folder… or select New Binder in the Actions pane on the right side of the window.
  1. Enter a name for the new folder. Go far something meaningful.
  1. Right-click on the new folder and select Create Task… or select Create Task… in the Actions pane.
  1. The Create Task window will open on the Full general tab. Enter a meaningful name for the task in the Proper noun: field. In the Description: field, write what the task does. Information technology'south a expert idea to put the location of the script that it calls. This makes it easier to change the task and script in the futurity.

    Note the Change User or Group push. This allows you to run the script under a different user. If your batch file requires Administrator permissions, you should change the user to Administrator. Information technology will ask you for the Administrator's countersign, so it's not a shortcut to have over the computer.

Also, note that the script volition Run only when the user is logged on. Yous can change this to Run whether user is logged on or not if you want it to run someday.

Note the other options. For most tasks, the default values are sufficient. Be enlightened that you tin make these changes if needed.

  1. Select the Triggers tab. Triggers are what volition decide when a task runs. Select New to create a trigger.
  1. There are many options in the New Trigger window. Look around to see what your options are.
  1. Select the basic trigger chore using the Begin the tasks drop-down menu. Options include:
    • On a schedule
    • At log on
    • At startup
    • On idle
    • On an event
    • At task creation/modification
    • On connection to user session
    • On disconnect from user session
    • On workstation lock
    • On workstation unlock

On a schedule is the well-nigh popular 1 and the one we'll use for this practice.

  1. There are options for scheduling Setting likewise. Choices include:
    • One fourth dimension
    • Daily
    • Weekly
    • Monthly.

Nosotros selected Daily for this example. You can also make up one's mind when the schedule starts and recurs.

  1. Under Advanced settings, you can fix more parameters effectually how the task triggers. This job is being set to repeat every 5 minutes, indefinitely. Note that the Enabled box is checked by default. This is the start place to check when troubleshooting why a scheduled job won't run. Select OK once you've set up the trigger.
  2. Select the Actions tab and and so New to tell the scheduled task what information technology'south going to practice.
  1. In the drib-downwardly menu Action: you have the option to:
    • Start a programme
    • Ship an e-mail
    • Display a bulletin.

The last 2 are deprecated and not supported options anymore. It's best not to use them when yous schedule batch files. Leave information technology on the default Beginning a program.

Enter the total path to the script. Utilise the Browse push to get to the script, and select it.

The Add arguments and Start in fields are bare. Yous might apply these when you lot progress to more complicated scripts and tasks. Y'all'll definitely need these to schedule PowerShell scripts. Select OK to proceed.

  1. The task is scheduled. Select OK to close the window and render to the Task Scheduler. Select the task you just fabricated and test information technology. Right-click on the task and select Run or select Run in the Actions pane.

When the task finishes, wait at the Concluding Run Result column. You should come across The operation completed successfully.

If it says anything else, try using the F5 button to refresh the screen. If it nonetheless says anything else, there's something wrong with your script or the fashion you scheduled the chore. Yous have some troubleshooting to do.

What Almost the Conditions and Settings Tabs?

Yes, there are two tabs nosotros didn't discuss in the to a higher place instructions. For most tasks, you don't demand to go into these tabs. In that location are default values set up in them that more often than not are all-time left lonely. Yet, let'due south take a expect at the tabs.

Create Task – Conditions

These settings relate to the state of the computer. If the task takes a lot of resources or tin interrupt the person using information technology, alter the Idle section.

The Power section defaults to having Start the task only if the computer is on AC power and End if the figurer switches to battery ability already checked.

In near cases when you lot schedule batch files, it's fine to exit these checked. We set some computers to become to slumber to save power when they're not being used. If the calculator is asleep, the task won't run. If that'south the case, you'll want to check the Wake the estimator to run this task box.

These days, a estimator is nigh always continued to a network. Withal, if your job depends on a solid network connection, alter the Network section.

Create Chore – Settings

The Settings tab relates to the behavior of the task. That ways how the task is running. The Let task to be run on demand is checked by default. The other choices chronicle to situations where a job gets skipped or fails.

Some tasks may get stuck in a loop, or not run because their trigger conditions aren't met. These are the settings you lot'd adjust to account for that. For most tasks, the default settings are skilful.

What Tin I Practice With Scheduled Batch Files?

In one case you know how to schedule tasks, the listen can race with ideas of things to automate. Y'all tin can auto delete files, set up favorite programs to open on login, or automatically clear the print queue of failed jobs. Whatever chore you do repeatedly, you can probably script information technology and schedule it.