So I managed to check if a sevice is running with sc query "ServiceName" | find "RUNNING" or net start | find "Service Name", or in SQL Server using xp_servicecontrol. Is there any way to see the uptime of a service? How can I see the uptime of a service?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
As long as your service has it's own process name, this should work.
If you're running under svchost.exe, i think you need to grab that from Event Log.
For Uptime, just compute time diff.
or as a one-liner: