Partager via


Schedule a Task

Applies To: Windows Server 2008, Windows Vista

You can schedule a task by either creating a basic task using the Create Basic Task Wizard or by creating a task without the wizard and supplying task information in the Create Task dialog box. The procedures below describe how to create a task using either method. If you create a basic task using the Create Basic Task Wizard, most of the task properties will be set to their default values, and you choose a trigger for the task from the most commonly used triggers. For more information about triggers, see Triggers.

You can import a task that is defined in an XML file. For more information, see Import a Task.

For information on creating a task on a remote computer, see Manage or Create a Task on a Remote Computer.

Scheduling a Task

  • Using the Windows interface

  • Using a command line

To create a basic task by using the Windows interface

  1. If Task Scheduler is not open, start Task Scheduler. For more information, see Start Task Scheduler.

  2. Find and click the task folder in the console tree that you want to create the task in. For more information about how to create the task in a new task folder, see Create a New Task Folder.

  3. In the Actions Pane, click Create Basic Task.

  4. Follow the instructions in the Create Basic Task Wizard.

To create a task by using the Windows interface

  1. If Task Scheduler is not open, start Task Scheduler. For more information, see Start Task Scheduler.

  2. Find and click the task folder in the console tree that you want to create the task in. If you want to create the task in a new task folder, see Create a New Task Folder to create the folder.

  3. In the Actions Pane, click Create Task.

  4. On the General tab of the Create Task dialog box, enter a name for the task. Fill in or change any of the other properties on the General tab. For more information about these properties, see General Task Properties.

  5. On the Triggers tab of the Create Task dialog box, click the New… button to create a trigger for the task, and supply information about the trigger in the New Trigger dialog box. For more information about triggers, see Triggers.

  6. On the Actions tab of the Create Task dialog box, click the New… button to create an action for the task, and supply information about the action in the New Action dialog box. For more information about actions, see Actions.

  7. (Optional) On the Conditions tab of the Create Task dialog box, supply conditions for the task. For more information about the conditions, see Task Conditions.

  8. (Optional) On the Settings tab of the Create Task dialog box, change the settings for the task. For more information about the settings, see Task Settings.

  9. Click the OK button on the Create Task dialog box.

To create a task by using a command line

  1. Open a command prompt. To open a command prompt, click Start, click All Programs, click Accessories, and then click Command Prompt.

  2. Type:

        schtasks /Create [/S <system> [/U <username> [/P [<password>]]]]
        [/RU <username> [/RP <password>]] /SC <schedule> [/MO <modifier>] [/D <day>]
        [/M <months>] [/I <idletime>] /TN <taskname> /TR <taskrun> [/ST <starttime>]
        [/RI <interval>] [ {/ET <endtime> | /DU <duration>} [/K] [/XML <xmlfile>] [/V1]]
        [/SD <startdate>] [/ED <enddate>] [/IT] [/Z] [/F]
    

To view the help for this command, type:

schtasks /Create /?

Additional Considerations

  • If the Remote Scheduled Tasks Management exception is disabled and the File and Printer Sharing exception is enabled in the Windows Firewall Settings, and the Remote Registry service is running, a V1 task will be created on the remote computer even when the V1 parameter is not specified. The V1 parameter specifies that a task is visible to down-level systems.

Additional references

Manage or Create a Task on a Remote Computer

Command-line syntax notation