Computing.Net > Forums > Windows XP > BAT files for restarting Apps

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

BAT files for restarting Apps

Reply to Message Icon

Name: waseem1234
Date: December 11, 2008 at 10:47:40 Pacific
OS: WIN XP
CPU/Ram: P4
Product: Gateway / E-MACHINE
Comment:

Hi,

I have an application running on a server. Once in a while the application hangs. Since the work is piled up we have to remote into the server to restart the application. Is there a way that I run a bat file that starts the application and if it hangs it kills it and restart it. It will be huge help if you can point me to a command or something. (just in case you want to know this application is doing some database updates after a math computing)

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: wanderer
Date: December 11, 2008 at 11:10:25 Pacific
Reply:

Perhaps someone can provide a script for you but I wanted to mention that just restarting the failed app can have some unfavorable results.

Failed/stalled apps don't remove from memory correctly. Just restarting them can corrupt memory which can result in a corrupted database and/or OS.

Proper procedure is to reboot the server to clear memory.

Your focus really should be in preventing the lockup/app failure not just getting it back online again.

Example of Oxymoron:
Person who is pro life and anti sex education.
Education is key to prevention. Prevent conception you prevent abortion. Abstinence training clearly isn't working.


0

Response Number 2
Name: waseem1234
Date: December 11, 2008 at 11:22:10 Pacific
Reply:

I was thinking when you use tkill command or Something it clears memory as well. Thanks for reminding that. Yeah if a script that will take care of memory and hanging would be great.


0

Response Number 3
Name: aegis
Date: December 11, 2008 at 13:23:59 Pacific
Reply:

If the Operating System is failing to clean up when an application abends, that's a problem.

But ignoring that possibility, I wonder if the following bat code will work:

:begin
dataappl.exe
dataappl.exe
goto begin

When the first dataappl.exe abends
Hopefully the second one will start
If/when it abends hopefully it will go back to :begin and start the process over.

I tried it with Notepad.exe instead of dataappl.exe and it worked ok. Of course I couldn't force an abend, I just closed Notepad.

It's really a kludge, and I guess it could lock up the system if dataappl.exe started failing solid.


0

Response Number 4
Name: jefro
Date: December 11, 2008 at 15:17:46 Pacific
Reply:

"Your focus really should be in preventing the lockup/app failure not just getting it back online again."

I agree. You are trying to fix the wrong thing with the batch file. Diag the application would be the best way to start.

It is kind of hard to monitor an application unless is was designed to report to event log. (if it is even able to when crashed) Some apps can report to event log and then more easily be automated.


See also SERVICES. If the application is set to run as a service it might be possible to select a recover from service mmc.

"Best Practices", Event viewer, host file, perfmon, antivirus, anti-spyware, Live CD's, backups, are in my top 10


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: BAT files for restarting Apps

.bat file for installing updates www.computing.net/answers/windows-xp/bat-file-for-installing-updates/138270.html

bat file for sig www.computing.net/answers/windows-xp/bat-file-for-sig/108681.html

XP Shim files for Incompatible Apps?? www.computing.net/answers/windows-xp/xp-shim-files-for-incompatible-apps/18007.html