locked
Error in scheduling a task in OS Scheduler of Win 7 and above (win 8, 2012 server etc), while specifying endTime for a task RRS feed

  • Question

  • I hit a strange issue while creating a schedule through command Prompt in Win 7

    i tried something like this

    schtasks /create /tn taskTest /tr task123 /sd 07/03/2013 /st 04:24 /ed 07/04/2013 /et 04:24 /sc minute /MO 4

    When I gave this command, I got the following error "ERROR: The duration (0m) between /ST and /ET must be greater than the repetition interval (4m).”

    Clearly the scheduler is taking the difference between the numerical values of startTime and endTime.

    Evenif the time belongs to different dates its saying the interval between the startTime and Endtime should be greater than the repetition interval(4 in the above case)

    Can anyone guide me in resolving this issue ?

    Wednesday, July 3, 2013 10:06 AM

Answers

  • Hi ManuParameswaran,

    Please try:

    schtasks /create /tn taskTest /tr task123 /sd 07/03/2013 /st 04:24 /ed 07/04/2013 /du 24:00 /sc minute /MO 4

    This should start it at 04:24, and run for 24 hours.

    Best regards,

    Karen Hu

    Thursday, July 4, 2013 9:05 AM

All replies

  • Hi ManuParameswaran,

    Please try:

    schtasks /create /tn taskTest /tr task123 /sd 07/03/2013 /st 04:24 /ed 07/04/2013 /du 24:00 /sc minute /MO 4

    This should start it at 04:24, and run for 24 hours.

    Best regards,

    Karen Hu

    Thursday, July 4, 2013 9:05 AM
  • Thanks a lot Karen Hu, this solved the issue,

    but when I saw the help for "schtasks /create", it showed up something like this for /du option -> "Specifies the duration to run the task. The time format is HH:mm. This is not applicable with /ET and for schedule types: ONSTART, ONLOGON, ONIDLE, ONEVENT. For /V1 tasks, if /RI is specified, duration defaults to 1 hour."

    The command which we initiated had /et option

    Thursday, July 4, 2013 1:35 PM
  • Hi Manuparameswaran,

    So my suggestion avoid to using /et option and use /du instead.

    Best regards,

    Karen Hu

    Monday, July 8, 2013 2:56 AM
  • There is one more issue while using end date and time

    This is with the " /change " command of schtasks (used to change the parameters of a task)

    When we apply this command say ;

    "schtasks /change /tn abc /ed 10/20/2013 /et 10:40 /rp <password>"

    -> let the current date be 08/20/2013

    the command will change the parameters of the task but it will add a default DURATION to it.

    Interesting thing is, the value ( DURATION ) will be no where related to the time gap given. In this case I got a duration of 2 hours 1 minute. That means, even if the task is supposed to end after 2 months, it will end after 2 hours

    Thursday, August 29, 2013 4:55 AM