Is task running

:: You can add more check by adding more if's

@ECHO OFF
SET TASKNAME=PingAServer
for /f "tokens=1,2 delims= " %%i in ('schtasks /QUERY ^|findstr /i running') do (
IF "%%i"=="%TASKNAME%" (
ECHO %TASKNAME% RUNNING
GOTO EOF
)
)
ECHO NOTHING RUNNING
:EOF
:: Enjoy

Comments :

0 comments to “Is task running”