How can I prevent multiple different task from task scheduler in Windows

1

Suppose I have multiple different task with different time based trigger, but I want to run only one task among them which trigger is same in specific scenario.
For example I have 10 different tasks. Tasks 1,3 and 5 are the same but triggered differently. When 1,3 and 5 task triggers conditions are the same I want to run just one task (instead of all 3 of them together).

Aman Singh

Posted 2016-06-03T10:29:01.913

Reputation: 11

Answers

1

When you create a task, you can have more than 1 trigger and more than 1 program/task to perform.

You can merge both tasks into 1 task, and set both triggers for that single task.

You now have the ability to set what happens if a task already is running and when the task should stop, if for some reason it did not shut down properly.

This will get you exactly what you need.


First, make sure you have just 1 task, so delete the other.

Now to configure the other task to do what you want, edit it and head to the Triggers tab. At the bottom, press New... and add a 2nd trigger.

Example: enter image description here

Now, it can happen that 2 triggers hit at the same time. In order to fix this, head to the Settings tab, so we can assure that this won't cause problems.

The default settings there are likely already good, but it doesn't hurt to check and adjust as necessary.

See: enter image description here Just make sure the task has enough time to run. If it runs for a day, then stopping it after 1 hour is obviously not good. Adjust as you see fit.

LPChip

Posted 2016-06-03T10:29:01.913

Reputation: 42 190

Thanks for your reply... can u explain in details? – Aman Singh – 2016-06-04T11:51:42.147

@AmanSingh I've edited the answer and added more clarification, including images. I hope this helps. – LPChip – 2016-06-04T13:52:36.187

thnks for your reply but its not working... – Aman Singh – 2016-06-07T12:39:51.867

Can you tell me what is not working? I've setup tasks like this a lot, so I know it should work. Does the task run if you right click the task and press Run Now? – LPChip – 2016-06-07T12:44:46.963

According to you, i set up 1 task with 2 different trigger and when both trigger collides then at that time both are running but this should not happen. – Aman Singh – 2016-06-09T05:15:56.690

The settings tab has a setting that explains it should not fire up a new one. I suppose you can set the trigger of the 2nd one with a 1 second or minute delay to ensure it will work, but in theory it should work fine as I specified in my answer. – LPChip – 2016-06-09T10:53:02.220