for /F “tokens=3 delims=: ” %%H in (‘sc query “MyServiceName” ^| findstr ” STATE”‘) do (
if /I “%%H” NEQ “RUNNING” (
REM Put your code you want to execute here
REM For example, the following line
net start “MyServiceName”
))
Tags
Active_Directory Adobe AFP ARD Background Boot Bootcamp Chrome Command Default User DEP Deployment Dual_Boot El Capitan External boot GIS Group_Policy High Sierra Image Installer JAMF KACE Keyserver Kiosk Lion Login Macintosh Matlab Mavericks Mt Lion Novell Packaging Reference Security Silent Installer SIP Sleep Software Spss Startup User_Profile VectorWorks Windows Windows 10 Windows to GoContact Me
Contact me by email ... [email protected]Login