Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums

Go Back   Vista Forums > Vista Forums > Tutorials

Task Scheduler - Create Task

Poll: Did this Tutorial help and work for you?
Poll Options
Did this Tutorial help and work for you?

Comment
 
Tutorial Tools Display Modes
<!-- google_ad_section_start -->Task Scheduler - Create Task<!-- google_ad_section_end -->
Task Scheduler - Create Task
How to Create a Task in Vista Task Scheduler
Published by Brink
02-21-2008

How to Create a Task in Vista Task Scheduler

INFO: Task Scheduler helps you schedule automated tasks that perform actions at a specific time or when a certain event occurs. It maintains a library of all scheduled tasks, providing an organized view of the tasks and a convenient point of access for managing them. From within the library, you can run, disable, modify, create, and delete tasks. This will show you how to create a task of your own in Task Scheduler.

NOTE: The two key concepts involved in scheduling a task are triggers and actions. A trigger causes a task to run and an action is the work that is performed when the task is run. The actions a task can perform include running a program, sending an e-mail message, and showing a message box.

WARNING: You will have to do this from within an Administrator account.

TASK SCHEDULER SCRIPTING:
NOTE: This is for advanced users. The scripting objects that are described in the following link provide programmatic access to the functionality that is available within the Task Scheduler for Visual Basic and Visual Basic script developers.
For details, see: Microsoft MSDN: Task Scheduler Scripting Objects

RELATED LINKS:
1. How to Setup Event Viewer to Send a E-mail Notification in Vista

2. How to Check and Change the Startup Programs in Vista

3. How to Set Windows Defender Automatic Scanning Schedule in Vista


STEP ONE:
Open Task Scheduler :
1. Open the Start Menu.
A) In the white line (Start Search) area, type taskschd.msc and press Enter.
B) Go to step 3.

OR

2. Open the Control Panel (Classic view).
A) Click on the Administrative Tools Icon.
B) Click on Task Scheduler.


STEP TWO:
Create a New Task Folder :
NOTE: You create a new task folder to store related tasks and other task folders to help keep them organized. You cannot rename a task folder once it is created, only delete it.

3. In the left pane click on Task Scheduler Library folder to highlight it. (See screenshot below)

4. In the right pane, click on New Folder.

Task_Scheduler1.jpg

5. Type in a name you want for this task. (See screenshot below)
NOTE: For example, Disk Cleanup.
A) Click OK.

Folder_Name.jpg


STEP THREE:
Create Task:
6. In the left pane, click on the new Task Folder. (See screenshot below)
NOTE: For example, Disk Cleanup.

7. In the right pane, click on Create Task.

Task_Scheduler2.jpg


STEP FOUR:
The General Tab:
NOTE: The general properties of a task include the task name, author, description, security options, the operating system that the task is configured for, and a property that controls whether the task is hidden.

8. Under Name, type in a name for the task. (See screenshot below step 10)
NOTE: For example, Disk Cleanup. When you create a task in a task folder, you must name the task. No two tasks can have the same name if they are in the same task folder.

9. Under Description, type in a description of the task. (See screenshot below step 10)
NOTE: The task description is optional, but recommended to help remember what it is for.

10. Under Security options, select the options you want. (See screenshot below)
NOTE: By default, a task runs within the security context of the user who scheduled the task and only runs if that user is logged on when the task is triggered.
A) If you want to Change User or Group for the task.
NOTE: After you click the Change User or Group button, see steps 14 to 16 in METHOD TWO OPTION ONE here: How to Take Ownership of a Item in Vista
B) Run only when user is logged on
NOTE: To have the scheduled task only run when the selected User is logged on.
C) Run whether user is logged on or not
NOTE: To have the scheduled task run whether the user is logged on or not. When this option is selected, you may be prompted to supply the password of the user account when saving the task, regardless of whether you selected the checkbox Do not store password or not.
D) Run with highest privileges
NOTE: This is the same as Run as Administrator, it will run the task using elevated privileges. Only tasks that require elevated privileges to complete their actions should run with elevated privileges. If your task does not run, then check this to see if it will afterwards.
E) Hidden
NOTE: This will hide the task in Task Scheduler unil you click View, then check Show Hidden Tasks.
F) Configure for
NOTE: This acts the same as Compatibility Mode. See: How to Use Compatibilty Mode in Vista

General_Tab.jpg


STEP FIVE:
The Triggers Tab:
NOTE: When setting up a task, first decide what will trigger that task to start. A trigger is a set of criteria that, when met, starts the execution of a task.

11. Click on the Triggers tab. (See screenshot below)
A) Click on the New button.

Triggers_Tab1.jpg

12. Click on the drop down arrow for Begin the task. (See screenshot below step 15)
A) Select what will be the trigger to run the task. (See screenshot below)

Triggers_On_Schedule.jpg

13. Under Settings, select how often you want the task to run. (See screenshot below step 15)
  • One time - Choose a date and time to trigger the task.
  • Daily - Choose the recurrence interval for the task and the date and time to start the task. An interval of 1 produces a daily schedule and an interval of 2 produces an every other day schedule. The task will start at the specified time each day.
  • Weekly - Choose the recurrence interval for the task, the date and time to start the task, and the days of the week in which to start the task. An interval of 1 produces a weekly schedule and an interval of 2 produces an every other week schedule. The task will start at the specified time on each of the specified days.
  • Monthly - Choose the months in which you want to start the task and the weeks of the month and the days of the week for each month in which you want to start the task. You can also specify that you want to start a task on the last day of each month.
14. Under Advanced Settings, select any settings you want. (See screenshot below step 15)
  • Delay task for up to (random delay) - This setting allows you to specify an amount of time to delay the task from running, after the task is triggered. If you are using a time-based trigger (On a schedule), then the delay time will be a random time between the time the task is triggered and the time specified in this setting.
  • Repeat task every - This setting allows you to set a repetition time interval for the task. The task will run, wait for the time interval specified, and then run again. This cycle will continue until the duration time is met.
  • Stop any task that runs longer than - This setting allows you to stop long running tasks by setting a time limit on the amount of time the task is allowed to run (execute the action).
  • Activate - This setting allows you to set a date and time to activate the trigger. Once a trigger is activated, the trigger can cause the task to run. The time is relative to the time zone that is set on the computer that runs the task. Check the Synchronize across time zones box to make the time relative to Coordinated Universal Time (UTC) instead of the time zone that is set on the computer that runs the task. Use the Universal setting when you want to coordinate a set of tasks to activate simultaneously in multiple time zones.
  • Expire - This setting allows you to set a date and time for the trigger to expire. When a trigger is expired, it can not cause the task to run. The time is relative to the time zone that is set on the computer that runs the task. Check the Synchronize across time zones box to make the time relative to Coordinated Universal Time (UTC) instead of the time zone that is set on the computer that runs the task. Use the Universal setting when you want to coordinate a set of tasks to expire simultaneously in multiple time zones.
  • Enabled - This setting allows you to enable or disable the task. A task that is enabled can run, and a task that is disabled cannot run until it is enabled.
15. Click OK. (See screenshot below)

Triggers_Tab2.jpg

16. You will now see the trigger listed. (See screenshot below)

Triggers_Tab3.jpg


STEP SIX:
The Actions Tab:
NOTE: A task action is the work that is performed when the task is run. A task can have a single action or a maximum of 32 actions. Each action contains settings that determine how the action is performed. When multiple actions are created, they are executed in sequential order starting with the action at the top of the list.

17. Click on the Actions tab. (See screenshot below)
A) Click on the New button.

Actions_Tab1.jpg

18. Next to Action, click on the drop down arrow. (See screenshot below step 19)
A) Select to do one of the action options in step 19, 20, or 21 below to do when the tasks runs. (See screenshot below)

Actions_Drop_Down_Menu.jpg

19. To Start a Program -
NOTE: This action starts a program or script. In the Program/script text box, enter the name of the program or script you want to start. If the program or script takes command line arguments, you can supply these arguments in the Add arguments (optional) text box. In the Start in (optional) text box, you can specify the working directory for the command line that executes the program or script. This should be either the path to the program or script file or the path to the files that are used by the executable file.
A) Click the Browse button. (See screenshot below)

Actions_Tab2.jpg

B) Navigate to the program's exe file. then select it and click Open. (See screenshot below)
NOTE: For example, the cleanmgr.exe file for Disk Cleanup.

Actions_Browse.jpg

C) Click OK. (See screenshot below step 19A)
D) Go to step 22.

20. To Send an E-Mail -
NOTE: This action sends an e-mail when a task is triggered. In the action settings you specify the e-mail address that the e-mail is from, the e-mail address that the mail will be sent to, the subject of the e-mail, the text in the e-mail message, and optional e-mail attachments. You must also specify the SMTP server that you use to send e-mail from.
A) Fill out the email information. (See screenshot below)
B) When done, click OK.
C) Go to step 22.

Actions_email.jpg

21. To Display a Message -
NOTE: This action shows a message box with a specified message and title. The action settings specify the text for the message box title and the text in the message. This action will only launch if the Run only if user is logged on security option is selected in the General tab of the Task Properties (Step 10B).
A) Type in a Title and Message to be displayed when the task runs. (See screenshot below)
B) When done, click OK.

Actions_Message.jpg

22. Click OK. (See screenshot below)
NOTE: The new action will now be listed.

Actions_Tab3.jpg


STEP SEVEN:
The Conditions Tab:
NOTE: Conditions control whether a task is run. A task will run if all of its conditions are met after the task is triggered to start. Conditions are split up into three categories: idle conditions, power conditions, and network conditions.

23. Click on the Conditions tab. (See screenshot below step 24)

24. Select the condition options you want.
A) Under the Idle section -
  • Start the tasks only if the computer is idle for - You can set a condition that tells the task to run only if the computer is in an idle state for a specific amount of time when a trigger is activated. When you set this condition, you also set the amount of time to wait (after the task is triggered) for the computer to enter an idle state.
  • Stop if the computer ceases to be idle - If this is selected for a task and the task is running while the computer is in an idle state, then the task will stop running when the computer ceases to be idle.
  • Restart if idle state resumes - This will allow the task to start running again if the computer becomes idle again if it was stopped from the Stop if the computer ceases to be idle condition above.
B) Under the Power section -
NOTE: You can set a condition that tells the task to run only if the computer is on AC power (not battery power) when the task trigger is activated. If this condition is set, you can also set a condition to stop the task if the computer switches to battery power. If both of these conditions are set for a task, then you have ensured that the task will only run when the computer is on AC power. You can also set a condition that tells the task to wake the computer from sleep mode to run the task when the trigger is activated. Before you set the condition to wake the computer to run the task, ensure that the task will not cause the computer to wake at inconvenient times.

C) Under the Network section -
NOTE: You can set a condition to run the task only if a specific named network connection is available or if any network connection is available when the task's trigger is activated. If your task action requires a network connection to execute, then set this condition.

Conditions_Tab.jpg


STEP EIGHT:
The Settings Tab:
NOTE: Task settings specify how a task is run, stopped, or deleted.

25. Click on the Settings tab. (See screenshot below)
A) Select the options you want.
  • Allow task to be run on demand - You can specify whether a task can be run manually before or after it is scheduled to run by allowing the task to be run on demand. The default setting allows a user to run the task at any time on demand.
  • Run task as soon as possible after a scheduled start is missed - If this setting is checked, the Task Scheduler service will start the task if the task was scheduled to run at a certain time, but for some reason (for example, the computer was turned off or the Task Scheduler service was busy) the task was not activated. The Task Scheduler service will not start the task immediately after the task was missed. By default the service waits ten minutes before starting the missed task.
  • If task fails, restart every - Use this setting to restart a task if the task fails to run. You specify the time interval that takes place between task restart attempts, and the number of times to try to restart the task.
  • Stop the task if it runs longer than - This setting allows you to limit the amount of time a task is allowed to run. Use this setting to limit tasks that might take a long period of time to execute, causing an inconvenience to the user.
  • If the task does not end when requested, force it to stop - If this setting is selected, the task will be forced to stop if the task does not respond to a request to stop.
  • If the task is not scheduled to run again, delete it after - If this setting is selected, the Task Scheduler service will automatically delete the task if it is not scheduled to run again. The Task Scheduler service will wait for the specified time period before deleting the task. If this setting is not selected, the Task Scheduler service will not automatically delete the task. The task must include at least one trigger with an expiration date in order to select this setting.
  • If the task is already running, then the following rule applies:
    • Do not start a new instance: The Task Scheduler service will not run the new instance of the task and will not stop the instance that is already running.
    • Run a new instance in parallel: The Task Scheduler service will run the new instance of the task in parallel with the instance that is already running.
    • Queue a new instance: The Task Scheduler service will add the new instance of the task to the queue of tasks that the service will run, and the service will not stop the instance of the task that is already running.
    • Stop the existing instance: The Task Scheduler service will stop the instance of the task that is already running, and run the new instance of the task.
Settings_Tab.jpg


STEP NINE:
Finishing the Task:
26. Click OK. (See screenshot above)
27. The task is now completed and listed in the new task folder created in step 4. (See screenshot below)
NOTE: For example, to have Disk Cleanup run once a week.

Finished.jpg

28. Close Task Scheduler.
NOTE: If you want to Delete the newly created task later, then just click on the task folder in the left pane or the task in the middle pane, and click Delete in the right pane.


That's it,
Shawn
Published by
Brink's Avatar
Administrator
Join Date: Apr 2007
Location: Texas, USA
Posts: 12,904
Rep Power: 200
Brink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond repute

Tutorial Tools

Applies to
All Vista Versions
64 Bit & 32 Bit

Rating
Skill Level
60%60%60%
3

Page copy protected against web site content infringement by Copyscape

Old 3 Weeks Ago  
Dwarf
The Contemplator
Dwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud ofDwarf has much to be proud of
 
Dwarf's Avatar
 
Join Date: Mar 2008
Vista Home Premium 32bit SP1
Posts: 305

Location: Doncaster, UK
Re: Task Scheduler - Create Task

A member of the Microsoft Discussion Groups posted the following question in the 'Vista account administration' sub forum, and I repeat it here, together with my reply.

"I can get Task Scheduler to display a message. However, if I am actually USING the pc when it is time for the reminder to activate then the message gets shunted to the back of the screen, and is "displayed" UNDERNEATH the open windows. In other words the reminder is NOT displayed, it's hidden, and doesn't remind anything. It is pretty damned useless like this (about as much as a chocolate teapot) and I can't find the option to display the message ON TOP of the other open windows (to be any good it should display on top by default).
Where is this option, or has this necessary action just been overlooked by microsoft?"

My reply (with illustrations for the tutorial):

"Try the following workaround.
Firstly, create a folder in the root of your system drive and name it 'UserTaskMessages'. Next, use 'Notepad' to create your message and save it in
this folder with a meaningful filename, for example 'Msg1'. Keep this folder open for reference purposes whilst you create your task.
Open 'Task scheduler'. In the left hand panel click to highlight 'Task Scheduler Library' and in the 'Actions' panel click 'Create Basic Task...'.
The 'Create Basic Task Wizard' opens on the 'Create a Basic Task' page. In the text box next to 'Name:', give your task a unique name, for example 'Test'. In the text box next to 'Description:' you can enter an optional description for your task, for example the filename of the desired message. Click 'Next >'.
Capture.JPG
The 'Task Trigger' page appears. Under 'When do you want the task to start?', click 'One time' and then click 'Next >'. This is for testing purposes.
Capture1.JPG
The 'One Time' dialogue page appears. Add 2 or 3 minutes to the time shown and then click 'Next >'. Remember that this is for testing purposes - you can amend the schedule by following the instructions later on in this post.
Capture2.JPG
The 'Action' dialogue page appears. Under 'What action do you want the task to perform?', you might think that the correct option is 'Display a message' but in fact the correct one is 'Start a program' (default). Click 'Next >'.
Capture3.JPG
The 'Start a Program' dialogue appears. Here you can enter the required parameters as follows. In the text box under 'Program/script:' enter
'C:\Windows\System32\notepad.exe'. In the text box next to 'Add arguments (optional):', enter the filename of the desired message that you created earlier. In the 'Start in (optional):' text box, enter the path to the folder you created earlier, in this case 'C:\UserTaskMessages'. Click 'Next >'.
Capture4.JPG
The 'Summary' page appears. Here you can review the information that you entered. If you wish to change anything, you can click '< Back' to go back to the relevant page to amend it. When you are happy with the settings, you can click 'Finish' on this page.
Capture5.JPG
The task will execute at the set time and the message will appear on top of any other open windows. Once you are satisfied that the task works, you can amend the schedule so that it executes at the desired time.
To do this, right click on the task and select 'Properties'. The properties page for the task will open in the 'General' tab. If you want the task to execute for all users, regardless of whether the task creator is logged in or not, click to select 'Run whether user is logged on or not' in the 'General' tab of the properties page.
Capture6.JPG
Click on the 'Triggers' tab, highlight the current trigger and then click 'Edit...'.
Capture7.JPG
The 'Edit Trigger' dialogue will open. Here you can amend the schedule for your task. Click 'OK' twice to close the properties dialogues and then close the 'Task Scheduler' and the 'UserTaskMessages' folder.
Capture8.JPG
Your task will execute according to your set schedule, and the message will appear on top of any other open windows.
Apologies for the length of this post, but I wanted to make it as clear as possible for you."

You can, if you wish, export a task and save it as a file so that it saves you time should you have to reinstall Vista for any reason and need the task. To do this, highlight the task and select 'Export...' from the 'Actions' panel. Choose an appropriate location and filename. To restore the task, click 'Import Task...' from the 'Actions' panel. Browse to the required location and then click on the task to be imported. The task will be imported into the 'Task Scheduler' and the properties page for the task will open in the 'General' tab as shown earlier. You can either click 'OK' now or amend the settings. Either way, once you have finished, the task will appear in the scheduler.
For those interested in the format of a task, the following illustrates the above example. This takes the format of an XML file, and those who are fluent in XML should be able to create tasks this way, although the 'Create Basic Task Wizard' is much simpler.
Capture9.JPG
Dwarf

Last edited by Dwarf; 3 Weeks Ago at 01:24 PM. Reason: (12/6/08) Added illustrations. (13/6/08) Added instructions for importing and exporting. Details of task as an XML file.
Dwarf is offline   Reply With Quote
Old 2 Weeks Ago  
nashntth
Ian
nashntth is on a distinguished road
 
Join Date: May 2008
home premium 64 OEM
Posts: 12

Re: Task Scheduler - Create Task

This tutorial seems pretty easy, I just used a registry cleaner and now my updater, automatic backup, and mcupdate are missing or corrupted. I was a extremely hesitant to mess with the scheduler, but now I will give it a shot. It's not so scary now. Thanks, I love the Vista 64 OS premium. I have not had any mentionable trouble with it.
nashntth is offline   Reply With Quote
Old 2 Weeks Ago  
Brink
Administrator
Brink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond repute
 
Brink's Avatar
 
Join Date: Apr 2007
Vista x64 Ultimate SP1
Posts: 12,904

Location: Texas, USA
Re: Task Scheduler - Create Task

Hi Nashntth,

You might check to see if the registry cleaner program that you used has a undo feature that can restore the changes you made from a backup of the registry that it made.

Hope this helps,
Shawn

There are no dumb questions, just the people that do not ask them.
Please post feedback to help others.
Brink is offline   Reply With Quote
Old 2 Weeks Ago  
nashntth
Ian
nashntth is on a distinguished road
 
Join Date: May 2008
home premium 64 OEM
Posts: 12

Re: Task Scheduler - Create Task

Shawn,
I have restored to pre reg clean, restored with windows restore. And restored with the initial back up I made after first boot up. no avail.

I have resigned to reinstall Vista, I have tried to schedule the back up task, no avail. My computer is one month new, so it won't be a big deal. And I would rather have a complete OS, rather than get down the road to find other problems or missing/corrupt files. It was a good lesson on what a reg cleaner does, now I fully understand again.

Thanks for your reply, it is comforting to know there is support from users.

ian

Last edited by nashntth; 2 Weeks Ago at 07:55 PM. Reason: forgot thanks
nashntth is offline   Reply With Quote
Old 2 Weeks Ago  
Brink
Administrator
Brink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond reputeBrink has a reputation beyond repute
 
Brink's Avatar
 
Join Date: Apr 2007
Vista x64 Ultimate SP1
Posts: 12,904

Location: Texas, USA
Re: Task Scheduler - Create Task

Your welcome Ian. I'm sorry that a System Restore did not help you and you having to do a reinstall. There are some registry cleaner programs out there that can be a bit overly agressive on what they find. It's always a good idea to go through the results to approve them to be safe.

Since you have Vista Home Premium and not Ultimate, your backup options are limited without a Complete PC Backup feature. If you are wanting one, I find that Acronis True Image is a great program to have for this. You can download and try a 15-day trial version here if you wanted to:

Complete hard disk drive copy, cloning and image backup software: computer files and disk copying


Shawn

There are no dumb questions, just the people that do not ask them.
Please post feedback to help others.
Brink is offline   Reply With Quote
 
Comment

Tags
scheduler, schedule, task

Tutorial Tools
Display Modes









Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Vistax64.com 2005-2008
Tutorial powered by GARS 2.1.8m ©2005-2006

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48