DaysOfWeek (weeklyScheduleType) Element

Specifies the days of the week in which the task runs.

<xs:element name="DaysOfWeek"
    type="daysOfWeekType"
 />

The DaysOfWeek element is defined by the weeklyScheduleType complex type.

Parent element

Element Derived from Description
ScheduleByWeek weeklyScheduleType Specifies a weekly schedule.

Child elements

Element Type Description
Friday Specifies that the task runs on Friday.
Monday Specifies that the task runs on Monday.
Saturday Specifies that the task runs on Saturday.
Sunday Specifies that the task runs on Sunday.
Thursday Specifies that the task runs on Thursday.
Tuesday Specifies that the task runs on Tuesday.
Wednesday Specifies that the task runs on Wednesday.

Remarks

The previous child elements are defined by the daysOfWeekType complex type.

For scripting development, the weekly interval is specified using the WeeklyTrigger.WeeksInterval property.

For C++ development, the weekly interval is specified using the IWeeklyTrigger::WeeksInterval property.

Examples

The following XML defines a daily 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>

For a complete example of the XML for a task that uses a weekly trigger, see Weekly Trigger Example (XML).

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