Click to Rate and Give Feedback
MSDN
MSDN Library
Task Scheduler
Using the Task Scheduler

This section contains code examples that illustrate how the Task Scheduler API is used and XML examples that show how tasks are defined in the Task Scheduler schema. Most of these examples are stand-alone code that can be run independently, or pasted into a larger application and modified to the requirements of the application.

The following table lists Task Scheduler 2.0 examples included in this section.

ExampleDescription
Showing a Message Box When an Event OccursDefines a task that shows a message box when an event occurs.
Sending an E-mail When an Event OccursDefines a task that sends an e-mail when an event occurs.
Starting an Executable at a Specific Time Defines a task that starts Notepad at a specified time.
Starting an Executable DailyDefines a task that starts Notepad daily.
Starting an Executable on System Boot Defines a task that starts Notepad when the system is booted.
Starting an Executable WeeklyDefines a task that starts Notepad on a weekly basis.
Starting an Executable When a Task is RegisteredDefines a task that starts Notepad when the task is registered.
Starting an Executable When a User Logs OnDefines a task that starts Notepad when a user logs on.
Enumerating Tasks and Displaying Task InformationEnumerates through all the tasks on the local computer and displays each task's state.

 

The following table lists Task Scheduler 1.0 examples included in this section.

ExampleDescription
Creating a Task Using NewWorkItem ExampleCreates a new task.
Enumerating Tasks ExampleEnumerates all the tasks on the local computer.
Starting a Task ExampleStarts a known task.
Editing a Work Item using Property PagesDisplays the property pages of a task for editing.
Retrieving Work Item Property ExamplesA set of examples that show how to retrieve properties that apply to all types of work items.
Setting Work Item Property ExamplesA set of examples that show how to set properties that apply to all types of work items.
Retrieving Task Property ExamplesA set of examples that show how to retrieve properties unique to tasks.
Setting Task Property ExamplesA set of examples that show how to set properties unique to tasks.
Retrieving a Task Page ExampleRetrieves and displays the general task page of a known task.
Creating a New TriggerCreates a new trigger for a known task.
Creating an Idle Trigger ExampleCreates an event-based idle trigger for a known task.
Terminating a Task ExampleTerminates a task while it is running.
Retrieving Trigger Strings ExampleRetrieves the trigger string of all triggers associated with a known task.

 

See Also

Task Scheduler
About The Task Scheduler

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker