Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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.

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.

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 beginWhen 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.

"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

![]() |
![]() |
![]() |

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