How to schedule a task to run every 10 minutes, from 8:00 to 15:00 on multiple days of week, i.e. on Mon,Tue,Wed?
The task I described can be defined with the GUI of Task Scheduler by using the 'Advanced' button in the 'Schedule' tab in the task Properties window. Is it possible to define the same task with one schtasks command? If yes, how would the command look like? If not, what would be the workaround.
Here is an example picture:
All the fields in the 'Advanced' window are similar to the Minute schedule type. Yet from what I've tested, it appears that I can't define two schedule types in one command (i.e. Minute + Weekly)
When options get a bit complicated, an alternative may be to manually create the task using the GUI with the configuration that you need, export it to an XML file, then use the command:
SCHTASKS /CREATE /XML <fileName>
to create a task on a target computer.Note that creating tasks from XML files are useful for other purposes, such as if you wanted to adjust the base priority of a task process.
I believe this is done through using commas to separate the /d command:
Similar to that.
As for the "repeat every X minutes between Y and Z" portion, I'm afraid that can't be done from the
schtasks
in Windows XP. In Vista and higher they added this functionality. The above screen would be written as:schtasks /Create /tn Runthings /tr C:\tasks\runthings.cmd /sc Weekly /d mon,tue,weds /st 08:00 /et 15:00 /ri 10