How to schedule task to run every 10 minutes, from 8:00 to 15:00 on multiple days of week (with schtask.exe)

command-line-interfacetask-schedulerwindows-xp

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:

enter image description here

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)

Best Answer

I believe this is done through using commas to separate the /d command:

schtasks /sc Weekly /tn Backups /d mon,wed,fri /tr [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