Created
December 4, 2014 05:49
-
-
Save erikccoder/23fcd1bca37917a9059c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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