Answer the question
In order to leave comments, you need to log in
How to make a .bat script that would automatically restart the "Not responding" server application?
I have a server application, the server may hang, Windows shows it as an application not responding.
Is it possible to somehow make a .bat script that would automatically restart such an .exe application?
Answer the question
In order to leave comments, you need to log in
Try something like:
@ECHO OFF
:CHECK
TASKLIST /NH /FI "IMAGENAME EQ CALC.EXE" /FI "STATUS EQ RUNNING" | FIND /I ":" > NUL
IF %ERRORLEVEL%==0 GOTO NOT_RUNNING
TIMEOUT /T 300 /NOBREAK
GOTO CHECK
:NOT_RUNNING
TASKKILL /IM CALC.EXE /T /F
START CALC.EXE
TIMEOUT /T 10 /NOBREAK
GOTO CHECK
Run your server under Kubernetes and check the survivability of the server in your own way.
It is not joke. Installing Kubernetes is easy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question