Check if Service is running and start it when it is not running.

Check if Service is running and start it when it is not running.

Created a batch script that will check if a service is running and will start it when it is not running. It is also usable with a scheduled task. Plain and simple, see below: @ECHO OFF SET SvcName=ServiceName SC QUERYEX "%SvcName%" | FIND "STATE" | FIND /v "RUNNING" > NUL && ( ECHO %SvcName% is not running ECHO START %SvcName% NET START "%SvcName%" > NUL || ( ECHO "%SvcName%" wont start EXIT /B 1 ) ECHO "%SvcName%" is started EXIT /B 0 ) || ( ECHO "%SvcName%" is running EXIT /B 0 ) You only need to change in the second line┬áServiceName to the name of the…

Read More