How to automate tasks in Windows

Automate tasks in Windows
Save yourself a job by scheduling your PC to defragment while you're at lunch

Every day when we turn on our PCs, we find ourselves firing up the same software and reading the same websites.

But instead of launching apps manually or typing in the URLs, Windows opens them up automatically for us. While we're away from our computers, it sometimes performs routine maintenance by defragging the disk or scanning for viruses.

The tool that turns your docile computer into a caring virtual nanny is the Windows Task Scheduler. All you have to do is make a list of tasks you'd like to automate and configure the Task Scheduler to handle them for you.

Task Scheduler can launch any app you have installed, and gives you extensive options to specify the time intervals when you want these tasks to run.

1. Launch Task Scheduler

Automate tasks in Windows

The easiest way to get to the tool is by typing Task Scheduler into the Start menu search. The main interface gives you an overview of the tool and lists all the active tasks. Before you create your own tasks, right-click on the 'Task Scheduler' library and select the 'New Folder' option to create a folder that will house all your custom tasks.

2. Create a task

Automate tasks in Windows

Select the folder you've created and go to 'Action>Create Task'. This will open the Create Task dialog box, which helps you define the task. Start by entering the name of the task. While it's safe to continue with the default Security options, which run the task as the current logged-in user, you also have the option to run the task as another user.

3. Set triggers

Automate tasks in Windows

Now switch to the Triggers tab and click the 'New' button to define the conditions that will trigger your chosen task. You can either start a task at a particular time of the day or during particular events, such as the computer booting up. For now, just select 'At log on' from the drop-down list, which will start the task when a user logs in.

4. Specify an action

Automate tasks in Windows

Head to the Actions tab and click the 'New' button to define the action that will take place when the task is triggered. The tool can perform three types of action. For now, select 'Start a program' from the Action drop-down list and point to an app (Internet Explorer, for example) in the space provided below, with the name of a website in the optional 'Add arguments' box.

5. Different action, same time

Automate tasks in Windows

You can also set multiple actions to occur at the same time. After adding the action in step 4, click the 'New' button again and ask the tool to launch another program that you want to run at start-up. We set it to start Excel, along with our to-do list, by pointing to excel.exe in the Settings section, along with the name of the file in the 'Add arguments' box and its location in the 'Start in' box.

6. Defrag disk when idle

Automate tasks in Windows

Now let's create a new task that will defrag the hard drive with the Windows Disk Defragmenter whenever your computer is idle. When creating this task, under the Action tab, point to the app you want to launch (usually C:\Windows\System32\Defrag.exe). Then head over to the Trigger tab and make sure you select the 'On idle' option when creating the trigger.

7. Set additional conditions

Automate tasks in Windows

When you select the 'On idle' option, you have to define additional settings that alert the Task Scheduler when the computer is idle. To set the idle settings, head to the Conditions tab and select one of the preset times from the drop-down list. For laptop users, there's also a checkbox that will ensure this task only runs when the computer is plugged in.

8. Display a message

Automate tasks in Windows

For any task that runs in the background, it's always helpful to create an action that displays a message to alert the user. For our defrag task, create a new action, but this time select the 'Display a message' option from the drop-down list and enter a message describing the event. We also use this feature to display messages reminding us to take care of chores during the day.

9. Control task behaviour

Automate tasks in Windows

You can further tune the behaviour of a task from the Settings tab. In most cases, the default settings should suffice, but some might require tweaking. For example, if you've set up a virus scan at a particular time and day, and your computer isn't switched on at that time, there's an option here that will run the task the next time the computer is on.

10. Export the task

Automate tasks in Windows

It might sound like a challenge at first, but once you've set up Task Scheduler, it will improve your Windows experience considerably. We've just scratched the surface and shown you how we use it every day. If you have multiple computers with the same programs installed, you can right-click on a task to export it, then import it into a custom folder on another computer.