This problem occurs because of how the Schtasks command-line tool stores the dates to run the scheduled task when you use the
lastday option. If the months that you specify in the
schtasks command have different numbers of days, the task is skipped in the months that have fewer days.
Consider the following example. You type the following command to schedule the c:\myapp.exe program to run on the last day of January, on the last day of February, and on the last day of March:
schtasks /create /tn "My App" /tr c:\myapp.exe /sc monthly /mo lastday /m JAN,FEB,MAR /st 18:00
The Schtasks command-line tool uses the following logic to schedule the task:
Run on day Number in months Month1, Month2, Month3
In this example, the Schtasks command-line tool uses the following settings to schedule the task that you specified:
Run on day 31 in months January, February, March
However, because February 31 is a date that is not valid, the task does not run in February.