Skip to content

Instantly share code, notes, and snippets.

@gotunandan
Created June 13, 2014 09:04
Show Gist options
  • Save gotunandan/14afb5fe9013b65b9a85 to your computer and use it in GitHub Desktop.
Save gotunandan/14afb5fe9013b65b9a85 to your computer and use it in GitHub Desktop.
@ECHO OFF
:LOOPING
set proc=
ECHO "Getting process list"
for /f "delims=" %%a in ('"tasklist | findstr %1"') do @set proc=%%a
ECHO %proc%
IF "%proc%" == "" GOTO START
TIMEOUT 5
GOTO LOOPING
GOTO END
:START
echo "Starting %1"
START /WAIT %1
GOTO :START
GOTO END
:END
ECHO "Script has ended"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment