Created
May 5, 2022 20:54
-
-
Save T3chArmy/bfc522556aeff11bf4384fac91b199a9 to your computer and use it in GitHub Desktop.
Script that will automatically launch SDRSharp, and will restart SDRSharp when it crashes
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 | |
set workdir="C:\SDRSharp\bin\" | |
set runprog="SDRSharp.exe" | |
set disname=SDRSharp | |
CD %workdir% | |
title Auto Restart %disname% | |
:search | |
tasklist /FI "IMAGENAME eq %runprog%" /FI "STATUS eq RUNNING" | find %runprog%>nul | |
IF %ERRORLEVEL% == 1 ( | |
tasklist /FI "IMAGENAME eq %runprog%" /FI "STATUS eq NOT RESPONDING" | find %runprog%>nul | |
IF %ERRORLEVEL% == 0 ( | |
echo %disname% stopped responding. | |
TASKKILL /IM %runprog% | |
) | |
GOTO:notfound | |
) | |
TIMEOUT /T 15 /NOBREAK>nul | |
GOTO:search | |
:notfound | |
echo Starting %disname% | |
start "" %runprog% | |
TIMEOUT /T 15 /NOBREAK>nul | |
goto:search |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment