TriggerCollection.Create method

For scripting, creates a new trigger for the task.

Syntax

TriggerCollection.Create( _
  ByVal type _
)

Parameters

type [in]

This parameter is set to one of the following TASK_TRIGGER_TYPE2 enumeration constants.

Value Meaning
TASK_TRIGGER_EVENT
0
Triggers the task when a specific event occurs.
TASK_TRIGGER_TIME
1
Triggers the task at a specific time of day.
TASK_TRIGGER_DAILY
2
Triggers the task on a daily schedule. For example, the task starts at a specific time every day, every-other day, every third day, and so on.
TASK_TRIGGER_WEEKLY
3
Triggers the task on a weekly schedule. For example, the task starts at 8:00 AM on a specific day every week or other week.
TASK_TRIGGER_MONTHLY
4
Triggers the task on a monthly schedule. For example, the task starts on specific days of specific months.
TASK_TRIGGER_MONTHLYDOW
5
Triggers the task on a monthly day-of-week schedule. For example, the task starts on a specific days of the week, weeks of the month, and months of the year.
TASK_TRIGGER_IDLE
6
Triggers the task when the computer goes into an idle state.
TASK_TRIGGER_REGISTRATION
7
Triggers the task when the task is registered.
TASK_TRIGGER_BOOT
8
Triggers the task when the computer boots.
TASK_TRIGGER_LOGON
9
Triggers the task when a specific user logs on.
TASK_TRIGGER_SESSION_STATE_CHANGE
11
Triggers the task when a specific session state changes.

Return value

A Trigger object that represents the new trigger.

Remarks

For information about each trigger type see Trigger Types.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Type library
Taskschd.tlb
DLL
Taskschd.dll

See also

Task Scheduler

Trigger