WeeklyTrigger object

Scripting object that represents a trigger that starts a task based on a weekly schedule. For example, the task starts at 8:00 A.M. on a specific day of the week every week or every other week.

Members

The WeeklyTrigger object has these types of members:

Properties

The WeeklyTrigger object has these properties.

Property Access type Description
DaysOfWeek
Read/write
Gets or sets the days of the week on which the task runs.
Enabled
Read/write
Inherited from the Trigger object. Gets or sets a Boolean value that indicates whether the trigger is enabled.
EndBoundary
Read/write
Inherited from the Trigger object. Gets or sets the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated.
ExecutionTimeLimit
Read/write
Inherited from the Trigger object. Gets or sets the maximum amount of time that the task launched by the trigger is allowed to run.
Id
Read/write
Inherited from the Trigger object. Gets or sets the identifier for the trigger.
RandomDelay
Read/write
Gets or sets a delay time that is randomly added to the start time of the trigger.
Repetition
Read/write
Inherited from the Trigger object. Gets or sets how often the task is run and how long the repetition pattern is repeated after the task is started.
StartBoundary
Read/write
Inherited from the Trigger object. Gets or sets the date and time when the trigger is activated.
Type
Read-only
Inherited from the Trigger object. Gets the type of the trigger.
WeeksInterval
Read/write
Gets or sets the interval between the weeks in the schedule.

Remarks

The time of day that the task is started is set by the StartBoundary property.

When reading or writing your own XML for a task, a weekly trigger is specified using the ScheduleByWeek element of the Task Scheduler schema.

Examples

For more information and a code example for this scripting object, see Weekly Trigger Example (Scripting).

Requirements

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

Trigger

TriggerCollection

TriggerCollection.Create