Редагувати

Поділитися через


MonthlyTrigger object

Scripting object that represents a trigger that starts a task based on a monthly schedule. For example, the task starts on specific days of specific months.

Members

The MonthlyTrigger object has these types of members:

Properties

The MonthlyTrigger object has these properties.

Property Access type Description
DaysOfMonth
Read/write
Gets or sets the days of the month during 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.
MonthsOfYear
Read/write
Gets or sets the months of the year during which the task runs.
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.
RunOnLastDayOfMonth
Read/write
Gets or sets a Boolean value that indicates that the task runs on the last day of the month.
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.

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 monthly trigger is specified using the ScheduleByMonth element of the Task Scheduler schema.

On the day that daylight savings time (DST) starts in a year, for a Pacific time zone (time shifted from 02:00 AM to 03:00 AM in 2022), any task that's scheduled to run between 02:00 AM and 02:59:59:999 AM will run at the earliest possible time that exists in that given day—that is, at 03:00 AM. This applies to all DST time zones based on the various times at which they observe DST.

Consider a weekly task that's set to run every Sunday of 2022 at 02:30 AM in the Pacific time zone such that the next run time is Mar 13, 2022 02:30 AM. As 02:30 AM is a time that doesn't exist on Mar 13, 2022, the task runs at 03:00 AM instead. On other Sundays of the year, the task runs as usual at 02:30 AM.

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

Trigger

Task Scheduler Objects

Task Scheduler

TriggerCollection

TriggerCollection.Create