Task Scheduler 2.0: Difference between "Stop task if..."

9,647

I have no authoritative reference but I have just tested the behavior of multiple different Stop conditions in Task Scheduler on both Windows 8.1, Server 2008 R2 and 2012 R2.

They both apply!

Whichever stop condition is met first, stops the task.

  • Per trigger stop condition: The Stop task if it runs longer than-condition specified in the Trigger will only apply when the task has been invoked by that particular trigger.

  • Per task stop condition: The Stop task if it runs longer than-condition specified for the Task (on the Settings tab) is global to that task, and will always apply, regardless of per-trigger stop conditions.

Example

Imagine a task with one trigger. If you have the per trigger stop condition set to 5 minutes, and the per task stop condition set to 30 minutes, you should expect the following behavior:

  • Task is invoked by the trigger -> Task stops after 5 minutes.
  • Task is invoked by you (via right-click and Run) -> Task stops after 30 minutes.
Share:
9,647

Related videos on Youtube

Ryan Ries
Author by

Ryan Ries

Windows Escalation Engineer at Microsoft. I debug things, with a particular fondness for Active Directory and coding. Disclaimer: This is my personal account and has no affiliation with my employer. All postings are provided "AS IS" with no warranties, and confer no rights. My posts do not represent the thoughts, intentions, plans or strategies of Microsoft. You should not consider out of date posts to reflect current thoughts and opinions.

Updated on September 18, 2022

Comments

  • Ryan Ries
    Ryan Ries over 1 year

    Using the Task Scheduler in Windows Server 2008 R2 or Windows 2012, etc...

    What is the difference between this setting:

    Stop task if it runs longer than

    and this setting on the same task:

    Stop task if it runs longer than

    Does one take precedence over the other? Do they conflict?

    • Mathias R. Jessen
      Mathias R. Jessen almost 10 years
      @TheCleaner Agreed ... testing as we speak :)
  • kralyk
    kralyk almost 10 years
    Nice job testing this!