Question How to configure scheduled task according to a condition

raysefo

Well-known member
Joined
Jul 21, 2010
Messages
207
Programming Experience
Beginner
Hi,

I have a scheduled task which sends email according to a specific condition. This task runs everyday at 07:30 AM. What I would like to know is, is there a way to know, if this task does NOT send email, the task should keep running lets say for 5 minutes interval till it meets this specific condition and sends the email. (lets say task will start for 3 times if email does not send)

eg.

07:30 AM task starts but specific condition is not occured so does not send email
07:35 AM task starts again because email did not send, if condition is not matched again, email does not send and
07:40 AM task starts again

Best Regards
 
Hi,
JohnH thanks for your reply. But I could not figure out how to do it what you said. I have console application which is scheduled. There is a condition in the application and if the condition is met, than email is send if not email is not send. How can I accomplish what you said ? Would you please tell me more detailed?

thanks in advance.
 
When you determine that failure has occurred you must set the exit code to a number other than 0.
 
No, you can configure the scheduler to repeat when the process has failed, as signified by the exit code.
 
In Vista it is in the Settings tab of the task configuration. There are options for 'if task fails' restart every x minutes' and 'restart x times'.
 
I m afraid no such options for XP
I guess that is true, and most relevant for the task at your hand. You probably have to use a third party scheduler for XP that supports such functionality or find some other way of achieving the goal, for example repeat attempts in the application.
 
Back
Top