Scheduling Task on Windows

We are a society of task driven people and it would be nice if such tasks can be automated so that we can set them once and forget. Automating a task on Windows may sound complicated but by no means, it meant to be so. It probably will take under 10 minutes to set up a task in Windows’ Task Scheduler and you are set.

Both Batch TIFF Resizer and Batch It Ultra comes with versions that support Command Line parameters which is the starting point for task scheduling. These includes the Command Line Edition and the Server Edition. Both of which are made with different users in mind. The Command Line Edition is made to automate your personal task on your desktop and the Server Edition is made to run a central server or web server. Knowing that Microsoft Windows has an excellent scheduling system in place, it did not make sense to mirror it.

Although this tutorial is geared towards Batch TIFF Resizer, you can use the task scheduler for running any application on a schedule.

The Task Scheduler is located under Administrative Tools and once you launch it, you will see something like this

Task Scheduler
Microsoft Task Scheduler is a little known tool which is extremely powerful when it comes automating your tasks

So where do we go from here ? I will bring you through the step by step to scheduling a task. First thing to do is on the Actions panel on the right, click “Create Task” and you get a popup window like the one below.

The General page let you set the permissions for the task
The General page let you set the permissions for the task

The Name and Description are for your own references and you can set up anything you want there which will be most descriptive to you. On the page, the most important settings is the Security Options. You can specify if you want to only run when the user (you) are logged on or run when the computer or server is on but not necessarily that you are log in. The significance is that Windows allows you to set up as different Users with different privileges running on the same computer. Most of the time, we will need to install applications as Administrator but probably on a regular day, you might be only provided with a much lower privileges for security. The highest privileges or Administrative privileges will have the most control as where to write files too.

For Batch TIFF Resizer and Batch It Ultra, it is always best to set up as the highest privileges.

Triggers are timing in which you want the automated task to run
Triggers are timing in which you want the automated task to run

The Trigger tab let you set up when you want to run the task. For the most time, setting the Begin the Task to “On a schedule” would be most relevant. In this settings, you can decide when you want to run the task and how often it should be repeated. Of course, if what you need is for the task to only begin when your computer is idling then set the Begin the task to “On idle”. This option is great when the task may be resource hungry but not mission critical to run on an interval.

I would like to set the schedule to “Daily”. The Start Time will be when the schedule will first began. If you need to run the task a few times a day then check the “Repeat task every” and set the interval timing and durations. If there is other specific timings you need to run the task then create a New trigger for each of this timing.

This is the entry point to specify the application to run and the parameters needed
This is the entry point to specify the application to run and the parameters needed

The Action specifies which application to start when the trigger is set. The only action is “Start a program”. Use the Browse to select the application you want the scheduler to run. The Add arguments or parameters are command line instructions to pass to the application. This is important for Batch TIFF Resizer and Batch It as they need instructions as to decide what need to be done. Without the arguments, the application will just start up and do nothing. Refer to the command line page of the Help file as to what the parameters are.

This list out the other conditions as to when to run the task such as when on AC and so on.
This list out the other conditions as to when to run the task such as when on AC and so on.

Most of the time, we will not need to do anything here. I will usually just check the “Wake the computer to run this task” otherwise in sleep mode or suspend mode, it will just ignore the task.

The Settings gives you more options when it comes to how you want the task to behave
The Settings gives you more options when it comes to how you want the task to behave

In the Settings tab, you will be able to set up what happens when things goes wrong or when there is a task conflict. There are times when the application crashes or takes too long to process which may overshoot to the next scheduled timing for the task to run. If you do not do nothing, there will be multiple spawn tasks running on the computer which will slow down the machine and drains resources. In this case, it is best to check the “Stop the task if it runs longer than” and set a reasonable timing. And also check the next item which is “If the running task does not end when requested, force it to stop”. This will take care of applications that is no longer responsive or crashed.

The “Run task as soon as possible after a scheduled start is missed” may be relevant if for somehow the computer is shut off due to a power failure or is turned off and the scheduled timing may be missed. In that case, the task will begin once the computer is turned on.

In the last dropdown box, there is the option as to what you want the task scheduler do when the current task is running but does not hit the timing set in the “Stop the task if it runs longer than”. The available options includes ignoring the new schedule, run the new schedule task alongside the current running, queue the task and run it after the current one ends or stop the existing one so that the new task can run.

I hope that the supposed complexity of scheduling task on Windows is debunked. It is relatively easy to do and it is immensely useful. If you have any suggestions for new tutorials, feel free to contact us at support@batchimage.com and we will do our best to come out with one.

Leave a Reply

*