My app needs a certain service installed and running… Is there a way to check for it ?
thanks
Roman
My app needs a certain service installed and running… Is there a way to check for it ?
thanks
Roman
Use a shell and call out to sc.exe.
[code]Dim theShell As New Shell
theShell.Mode = 0
theShell.Timeout = -1
theShell.Canonical = True
theShell.Execute "sc.exe query " + process_common_name[/code]
For example, to check for our BRU Server Agent in a Console app:
theShell.Execute "sc.exe query ""BRU Server Agent"""
Print theShell.ReadAll
Returns:
SERVICE_NAME: BRU Server Agent
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
thanks Tim!