Funcion, averiguar si un servicio esta corriendo:
:: Autor ne0x
:: Sintaxis:
:: call:svc nombre variable
:: nombre Nombre del servicio a chequear
:: variable Nombre de la variable en la que se pondra la respuesta en dato boleano
:svc
net start | find "%~1" > nul
if %errorlevel%==0 (
set %2=0
) ELSE (
set %2=1
)
goto:EOF
Funcion, averiguar si se ha iniciado un proceso:
:: Autor ne0x
:: Sintaxis
:: call:pr nombre variable
:: nombre Nombre del proceso a chequear
:: variable Nombre de la variable en la que se guardara la respuesta en tipo boleano.
:pr
taskklist | find "%~1"
if %errorlevel%==0 (
set %2=0
) ELSE (
set %2=1
)
goto:EOF