Restart crashed program?

  • Thread starter Thread starter Evren
  • Start date Start date
E

Evren

I have a program crashing sometimes. I need a program or something checking
if this program is running and and if not start the program..


Evren
 
I have a program crashing sometimes. I need a program or something checking
if this program is running and and if not start the program..


Evren

Download PsList from http://www.sysinternals.com/utilities/pslist.html
Schedule the following, assuming your program is called program.exe in folder "C:\program files\my programs"

@echo off
setlocal
cd /d "C:\program files\my programs"
:again
@ping -n 61 127.0.0.1>nul
set OK=N
for /f "Tokens=1" %%a ('pslist^|find /i "program"') do (
set OK=Y
)
if "%OK%" EQU "Y" goto again
start /min "C:\program files\my programs\program.exe"
goto again



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Back
Top