@echo off

for /F "tokens=3 delims=: " %%H in ('sc query sensrSvc ^| findstr "        STATE"') do (
  if "%%H" == "RUNNING" (
	REM we have to wait till FW reset is over
	powershell Start-Sleep -s 2
	powershell Restart-Service sensrSvc
  )
)
