I need to know the status of a service at the end of my batch script which restarts services using \"net stop thingie\" and \"net start thingie\".
In my most favorite id
Have you tried sc.exe?
sc.exe
C:\> for /f "tokens=2*" %a in ('sc query audiosrv ^| findstr STATE') do echo %b 4 RUNNING C:\> for /f "tokens=2*" %a in ('sc query sharedaccess ^| findstr STATE') do echo %b 1 STOPPED
Note that inside a batch file you'd double each percent sign.