:IsServiceRunning service -- returns success if service is running, otherwise failure :: -- service [in] - name of the service to check SETLOCAL ENABLEDELAYEDEXPANSION sc query "%~1"|findstr "STATE.*:.*4.*RUNNING">NUL EXIT /b