Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I schedule a task in Windows Task Scheduler, I can set "stop the task if it runs longer than" inside task trigger or inside Settings tab.

If I set it inside the trigger it does not automatically populate into Settings, so I think it's different, but what is the difference and which one is better to use?

share|improve this question
2  
I believe the shorter duration will supersede the longer one. –  sajawikio Nov 16 '12 at 19:29
1  
Also let's say you make two triggers that say "run one time" one on Tuesday one one Wednesday. If on Tuesday you stop task if run longer than one day, and Wednesday you stop task if run longer than two days, then they will be different. Now suppose on settings tab it says stop if run after 0.5 days, probably that one will supersede –  sajawikio Nov 16 '12 at 19:32
    
Or what if it's backwards - it could be that the "Settings" one applies unless the more specific one in the "Triggers" is specified and if so that one only applies and not the "Settings" one? - test it out and let me know which is it. –  sajawikio Nov 16 '12 at 19:32
add comment

1 Answer

I think @sajawikio has it right - the per-trigger "Stop task" option allows you to set multiple triggers which each have their own maximum runtime allowance, where the option on the Settings tab globally applies to all instances of the task.

Example: On one task, I have multiple triggers set. One is to run every Monday at midnight, the other is to run every Thursday at midnight. There's two ways (there's really more, but we're only using the "stop the task..." option here) I could set up the task so that there's never an overlap.

  1. I could set the whole task (under the Settings tab) to have a maximum run-time of 3 days. This prevents task overlapping in the simplest way.

  2. I could set the maximum run-times separately (in the Trigger dialog) for each task. The Monday task would be set to 3 days, and the Thursday task would be set to 4. This gives the Thursday task an extra day to run (should it be needed) while still preventing overlaps.

What would happen if this option is set in both the Triggers screen and the Settings tab? This would require some testing, but there's three possibilities:

  1. Per-trigger options override the global option entirely.
  2. A global option overrides the per-trigger options entirely.
  3. The shortest duration set for the current task wins.

I checked the Help file, and didn't see any clarification on this. To make your tasks perform in a reliable and predictable manner, I suggest you choose one method or the other - never use both together.

share|improve this answer
add comment

Your Answer

 
discard

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.