07-16-2012, 11:08 AM
The code is good, checks for the process if exists and it it has the status running then it starts a new process, if the process doesnt exist:
@echo off
echo Starting Connector Restarter
tarttasklist /nh /fi "imagename eq Connector.exe" /fi "status eq running" | find /i "Connector.exe" >nul && (
tasklist /nh /v /fi "status eq Not Responding" | find /i "Connector.exe" >nul && (
echo "Connector.exe" crashed
taskkill /im Connector.exe /f
taskkill /im WerFault.exe /f
start Connector.exe
)||(
echo "Connector.exe" found
)
) || (
echo "Connector.exe" not found
start Connector.exe
)
timeout /t 200 /nobreak
goto start

