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](../../I/static/images/2c46c27322ad810b6ba1629a3b5cd4f47ec4e14ecf9185b4bdcd6e8ebd0346a4.png)
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:
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.
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