Schtasks /chage results in next-run-time field being empty

    General discussion

  • I hit an issue while modifying a scheduled task in the system.

    After changing the parmeters of the task im getting a success message from theOS schduler but the next-run-time filed in the scheduler becomes empty. Thereby making the task never to run again

    The following steps are followed to reproduce the issue

    1. Create a task in OS scheduler
      1. Eg :- schtasks  /create /tn Task_Name /tr notepad.exe /SC MINUTE /MO 4 /ST 01:46 /SD 07/16/2013 /ru <user-name> /rp <password>
    2. Allow it to run for a day
    3. Try to modify the task the next day as follows
      1. Eg : /change /tn Task_Name /rp <password> /ed 12/31/9999 /et 23:59
      2. We will get a success message from OS scheduler, like this :- “SUCCESS: The parameters of scheduled task " Task_Name " have been changed. ”
      3. But the “next-run-time ” field in the OS scheduler will become empty and the task will never run

    Note : We can’t avoid using the /ed and /et option having the max value for dateTime because of some use cases in our work

    This happens in Win7, win8 win server 2008 R2 etc

    Wednesday, July 17, 2013 9:19 AM