Windows Vista Forums

Task Scheduler - Create Task

  1. #1
    <!-- 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 is offline
    21 Feb 2008
    Task Scheduler - Create Task

    How to Create a Task in Vista Task Scheduler

    information   Information
    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. For a description of all of the default tasks in Vista, see: Microsoft Help and Support: KB939039
    Note   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   Warning
    You will have to do this from within an Administrator account.
    Tip   Tip

    TASK SCHEDULER SCRIPTING:
    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 more details on this, see: Microsoft MSDN: Task Scheduler Scripting Objects




    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 in Step Two.
    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. Click on Continue in the UAC Prompt.

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

    5. In the right pane, click on New Folder.
    6. Type in a name you want for this task. (See screenshot below)
    NOTE: For example, Disk Cleanup.
    A) Click on OK.
    Task Scheduler - Create Task-folder_name.jpg




    STEP THREE

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

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




    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.
    9. Under Name, type in a name for the task. (See screenshot below step 11)
    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.

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

    11. Under Security options, select the options (see table below) you want. (See screenshot below table)
    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.

    Security Option Description
    Change User or Group To change the user or group for the task to use. 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
    Run only when user is logged on To have the scheduled task only run when the selected User is logged on.
    Run whether user is logged on or not 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.
    Run with highest privileges 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.
    Hidden This will hide the task in Task Scheduler unil you click View, then check Show Hidden Tasks.
    Configure for For computers that are running Windows Server 2008 R2, Windows 7, Windows Server 2008, or Windows Vista, you can restrict the options displayed to those that are also available in earlier operating systems. However, doing this does not configure the task or the preference item to run on earlier operating systems.

    Task Scheduler - Create Task-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.
    12. Click on the Triggers tab. (See screenshot below)
    A) Click on the New button.
    Task Scheduler - Create Task-triggers_tab1.jpg
    13. Click on the drop down arrow for Begin the task. (See screenshot below step 16)
    A) Select what will be the trigger to run the task. (See screenshot below)
    NOTE: For this tutorial, I will use the On a Schedule option.
    Name:  Triggers_On_Schedule.jpg
Views: 87233
Size:  11.4 KB
    14. Under Settings, select how often you want the task to run. (See table below and screenshot below step 16)
    NOTE: The settings will vary depending on what you selected in step 13A. These settings are for the On a Schedule option.

    Setting Description
    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.


    15. Under Advanced Settings, select any settings you want. (See table below and screenshot below step 16)
    NOTE: The settings will vary depending on what you selected in step 13A. These settings are for the On a Schedule option.

    Advanced Setting Description
    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.


    16. Click on OK. (See screenshot below)
    Task Scheduler - Create Task-triggers_tab2.jpg
    17. You will now see the trigger listed. (See screenshot below)
    Task Scheduler - Create Task-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.
    18. Click on the Actions tab. (See screenshot below)
    A) Click on the New button.
    Task Scheduler - Create Task-actions_tab1.jpg
    19. Next to Action, click on the drop down arrow. (See screenshot below step 20)
    A) Select to do one of the action options in step 20, 21, or 22 below to do when the tasks runs. (See screenshot below)
    Task Scheduler - Create Task-actions_drop_down_menu.jpg
    20. 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 on the Browse button. (See screenshot below)
    NOTE: For the Disk Cleanup Example, you would use C:\Windows\System32\cleanmgr.exe /sagerun: 1 for it to run automatically for the C: drive.
    Task Scheduler - Create Task-actions_tab2.jpg
    B) Navigate to the program's exe file. then select it and click on Open. (See screenshot below)
    NOTE: For example, the cleanmgr.exe file for Disk Cleanup.
    Task Scheduler - Create Task-actions_browse.jpg
    C) Click on OK. (See screenshot below step 19A)

    D) Go to step 23.
    21. 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 on OK.

    C) Go to step 23.
    Task Scheduler - Create Task-actions_email.jpg
    22. 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 on OK.
    Task Scheduler - Create Task-actions_message.jpg
    23. Click on OK. (See screenshot below)
    NOTE: The new action will now be listed.
    Task Scheduler - Create Task-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.
    24. Click on the Conditions tab. (See screenshot below step 25)

    25. Select the condition options you want.
    A) Under the Idle section - (See table below)

    Option Description
    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.
    Task Scheduler - Create Task-conditions_tab.jpg




    STEP EIGHT

    The Settings Tab

    NOTE: Task settings specify how a task is run, stopped, or deleted.
    26. Click on the Settings tab. (See screenshot below)
    A) Select the options you want. (See table below)

    Setting Description
    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 The button with the drop down menu.
    • Do not start a new instance
    • Run a new instance in parallel
    • Queue a new instance
    • Stop the existing instance
    • The Task Scheduler service will not run the new instance of the task and will not stop the instance that is already running.
    • The Task Scheduler service will run the new instance of the task in parallel with the instance that is already running.
    • 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.
    • The Task Scheduler service will stop the instance of the task that is already running, and run the new instance of the task.
    Task Scheduler - Create Task-settings_tab.jpg




    STEP NINE

    Finishing the Task
    27. Click on OK. (See screenshot above)

    28. The task is now completed and listed in the new task folder created in step 5. (See screenshot below)
    NOTE: For example, to have Disk Cleanup run once a week.
    29. 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 on Delete in the right pane.
    That's it,
    Shawn




    Published by


    Brink's Avatar
    Administrator

    Join Date: Apr 2007
    Location: Texas, USA
    Posts: 31,060
    Array

    Tutorial Tools


    Applies to

    All Vista Versions
    64 Bit & 32 Bit


  2.   


  3. #1
    Dwarf's Avatar

    The Contemplator



    Join Date : Mar 2008
    Doncaster, UK
    Posts : 2,760
    Windows 8.1 Pro RTM x64
    Local Time: 01:01 PM
    england uk yorkshire

    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 >'.
    Task Scheduler - Create Task-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.
    Task Scheduler - Create Task-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.
    Task Scheduler - Create Task-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 >'.
    Task Scheduler - Create Task-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 >'.
    Task Scheduler - Create Task-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.
    Task Scheduler - Create Task-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.
    Task Scheduler - Create Task-capture6.jpg
    Click on the 'Triggers' tab, highlight the current trigger and then click 'Edit...'.
    Task Scheduler - Create Task-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.
    Task Scheduler - Create Task-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.
    Task Scheduler - Create Task-capture9.jpg
    Dwarf

    Last edited by Dwarf; 13 Jun 2008 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.
      My System SpecsSystem Spec

  4.   


  5. #2



    Junior Member
    Join Date : May 2008
    Rawlins, WY
    Posts : 20
    Home Premium 64 OEM w/SP1
    Local Time: 06:01 AM
    usa us wyoming

     

    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.

      My System SpecsSystem Spec

  6. #3
    Brink's Avatar

    Administrator


    Join Date : Apr 2007
    Texas, USA
    Posts : 31,060
    64-bit Windows 8.1 Enterprise (RTM)
    Local Time: 07:01 AM
    usa us texas

      Thread Starter

    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

      My System SpecsSystem Spec

  7. #4



    Junior Member
    Join Date : May 2008
    Rawlins, WY
    Posts : 20
    Home Premium 64 OEM w/SP1
    Local Time: 06:01 AM
    usa us wyoming

     

    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; 18 Jun 2008 at 07:55 PM. Reason: forgot thanks
      My System SpecsSystem Spec

  8. #5
    Brink's Avatar

    Administrator


    Join Date : Apr 2007
    Texas, USA
    Posts : 31,060
    64-bit Windows 8.1 Enterprise (RTM)
    Local Time: 07:01 AM
    usa us texas

      Thread Starter

    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

      My System SpecsSystem Spec

  9. #6



    Newbie
    Join Date : Sep 2008
    Posts : 2
    Vista Ultimate x64
    Local Time: 06:01 AM


     

    Re: Task Scheduler - Create Task

    Im curious who to allow the diskcleaner to run but on multiple HD's. The above works now but it comes up with and options and gets stuck asking me to select which hard drive to run on.

    -Drew

    Last edited by ataylor20; 10 Sep 2008 at 01:28 PM.
      My System SpecsSystem Spec

  10. #7
    Brink's Avatar

    Administrator


    Join Date : Apr 2007
    Texas, USA
    Posts : 31,060
    64-bit Windows 8.1 Enterprise (RTM)
    Local Time: 07:01 AM
    usa us texas

      Thread Starter

    Re: Task Scheduler - Create Task

    Hello Drew, and welcome to Vista Forums.

    Try using C:\Windows\System32\cleanmgr.exe /sagerun: 1 instead in step 20. It should run automatically after that.

    Hope this helps,
    Shawn

      My System SpecsSystem Spec

  11. #8



    Newbie
    Join Date : Dec 2008
    Posts : 4
    Business 32
    Local Time: 10:01 PM


     

    Re: Task Scheduler - Create Task

    Thanks a heap for this tute - can't believe how such an easy process has been made so tricky! I tried everything but didn't realise that you had to create a directory for your task - MS's error message was singularly unhelpful!

    Peter

      My System SpecsSystem Spec

  12. #9
    Brink's Avatar

    Administrator


    Join Date : Apr 2007
    Texas, USA
    Posts : 31,060
    64-bit Windows 8.1 Enterprise (RTM)
    Local Time: 07:01 AM
    usa us texas

      Thread Starter

    Re: Task Scheduler - Create Task

    You're welcome Peter, and welcome to Vista Forums.

    Shawn

      My System SpecsSystem Spec

Page 1 of 2 12 LastLast

Task Scheduler - Create Task
Similar Threads
Tutorial Category
Task Scheduler Compatibility module task status update failed General Discussion
Solved In Task Scheduler, what's the difference between Create Basic Task and Create Task? General Discussion
Task Scheduler Error-task image corrupt or has been tampered with User_Feed_Synchroni General Discussion
Task Scheduler: Create task to open webpage? Vista General
Task scheduler returns an error : the task image is corrupt ortamp Vista performance & maintenance