Solved

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

Posted on 2008-10-08
2
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 69

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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