• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

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
0
nss39759
Asked:
nss39759
1 Solution
 
SysExpertCommented:
Run it as a scheduled task.

 
I hope this helps !
0
 
QlemoC++ DeveloperCommented:
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now