Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since task scheduler API has been changed after Vista & Server 2008, scheduling a task with schtasks is (as much as I know) the only way that works on both Windows 2003 Server and Windows 2008 Server.

I need to create a task that will run every on 5th and 20th of each month. Is this possible with schtasks.exe?

Creating a scheduled task that will run on every sunday and monday of a week is possible with:

schtasks /create /tn test /tr "cmd.exe" /sc weekly /d mon,sun

But with the same aspect, any of the following is not working.

schtasks /create /tn test /tr "cmd.exe" /sc monthly /d 5,15

schtasks /create /tn test /tr "cmd.exe" /sc monthly /d "5 15"

Any ideas?

share|improve this question
The mon,sun syntax doesn't work for me either. – jwg Sep 24 '14 at 16:30
Having a non-English locale settings may cause this, I believe. – dereli Sep 27 '14 at 21:32
Not sure, because /d "mon sun" does work. – jwg Sep 28 '14 at 22:23
up vote 3 down vote accepted

Schedule two monthly tasks. One for the 5th and one for the 15th.

share|improve this answer
+1. Simple and ingenious. – joeqwerty Jan 21 '10 at 15:15
Actually, I don't like this, but this seems to be the only solution. – dereli Jan 26 '10 at 18:43

You could create a task using an XML file:

schtasks /Create /XML xmlfile

(see documentation).

The XML should contain a <ScheduleByMonth> section:


You can create the XML file using the GUI version of the Task Scheduler. Use the "Export" function. Here is an example file:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="">
          <January />
          <February />
          <March />
          <April />
          <May />
          <June />
          <July />
          <August />
          <September />
          <October />
          <November />
          <December />
    <Principal id="Author">
  <Actions Context="Author">
      <Title>Test Message</Title>
      <Body>TThis is a test task message.</Body>
share|improve this answer
/xml argument is not supported on Windows 2003 Server. – dereli Jan 26 '10 at 18:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.