Skip to content

Instantly share code, notes, and snippets.

@erikccoder
Created December 4, 2014 05:49
Show Gist options
  • Save erikccoder/23fcd1bca37917a9059c to your computer and use it in GitHub Desktop.
Save erikccoder/23fcd1bca37917a9059c to your computer and use it in GitHub Desktop.
@echo off
:: app_restart.bat
:: %1 path of application
:loop
tasklist /fi "Status eq NOT RESPONDING" | findstr %~nx1
if %errorlevel%==0 (
echo "kill task"
taskkill /f /im %~nx1
taskkill /f /im "WerFault.exe"
)
timeout 1
:checkRunning
tasklist | findstr %~nx1
if %errorlevel%==1 (
start "" %~f1
)
timeout 9
goto loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment