Creating A Batch Scripts That Restarts Itself Automatically at Regular Predefined Intervals

I currently have a batch script that polls a "service" every five (5) minutes. At times, the "service" that is being polls takes longer to respond for various reasons. The polling batch script hangs as a result. However, simply restarting the scrip, by closing one command window and running the script in a new command window resolves the issue.  

Therefore, I wish to achieve one of the following outcomes:
1.)  Append code to the existing batch script to restart itself at a predefined interval that I can easily modify
2.)  Write a separate script that closes and re-opens the polling script at a predefined interval that I can easily modify

Thank you in advance,
nss39759
nss39759Asked:
Who is Participating?
 
SysExpertConnect With a Mentor Commented:
Run it as a scheduled task.

 
I hope this helps !
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I would use a Scheduled Task running every 5 min. for polling, and a limitation to 5 min. That way, if the job hangs, it will be killed and restarted automatically.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.