ScheduleByWeek (calendarTriggerType) Element

Specifies a weekly schedule. For example, the task starts at 8:00 AM on a specific day of the week every week or on a specific day of the week every other week.

<xs:element name="ScheduleByWeek"
    type="weeklyScheduleType"
 />

The ScheduleByWeek element is defined by the calendarTriggerType complex type.

Parent element

Element Derived from Description
CalendarTrigger calendarTriggerType Specifies a daily, weekly, monthly, or a monthly day-of-the-week (DOW) trigger.

Child elements

Element Type Description
DaysOfWeek daysOfWeekType Specifies the days of the week in which the task runs.
WeeksInterval unsignedByte Specifies the interval between the weeks in the schedule.

Remarks

The child elements listed above are defined by the weeklyScheduleType complex element types.

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

For scripting development, a weekly trigger is specified using the WeeklyTrigger object.

For C++ development, a weekly trigger is specified using the IWeeklyTrigger interface.

Examples

The following XML defines a weekly calendar trigger that starts a task Monday through Friday (at 8:00 AM) every week.

<CalendarTrigger>
    <StartBoundary>2005-01-01T08:00:00</StartBoundary>
    <EndBounadry>2007-01-01T00:00:00</EndBoundary>
    <ScheduleByWeek>
        <WeeksInterval>1</WeeksInterval>
        <DaysOfWeek>
            <Monday/>
            <Tuesday/>
            <Wednesday/>
            <Thurday/>
            <Friday/>
        </DaysOfWeek>
    </ScheduleByWeek>
</CalendarTrigger>

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]

See also

Task Scheduler Schema Elements

Task Scheduler