Skip to content

Instantly share code, notes, and snippets.

@T3chArmy
Created May 5, 2022 20:54
Show Gist options
  • Save T3chArmy/bfc522556aeff11bf4384fac91b199a9 to your computer and use it in GitHub Desktop.
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
@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