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
If PowerShell is available to you...
Get-Service -DisplayName *Network* | ForEach-Object{Write-Host $_.Status : $_.Name}
Will give you...
Stopped : napagent
Stopped : NetDDE
Stopped : NetDDEdsdm
Running : Netman
Running : Nla
Stopped : WMPNetworkSvc
Stopped : xmlprov
You can replace the ****Network**** with a specific service name if you just need to check one service.