Solved

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

Posted on 2008-10-08
2
404 Views
Last Modified: 2010-04-16
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
Comment
Question by:nss39759
2 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 500 total points
ID: 22674006
Run it as a scheduled task.

 
I hope this helps !
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 22674028
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now