What is the elegant way in VB.NET to check whether a windows service is
installed or not?
How does the service controller tell this?
thanks herbert
Kevin Spencer - 29 Jan 2006 14:23 GMT
It's in the System Registry.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

Signature
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
> What is the elegant way in VB.NET to check whether a windows service is
> installed or not?
>
> How does the service controller tell this?
>
> thanks herbert
John Galt - 30 Jan 2006 02:09 GMT
Imports System.ServiceProcess
Module Module1
Sub Main()
Dim services() As ServiceController =
ServiceController.GetServices()
For Each service As ServiceController In services
' Do comparison here to determine if service is installed
Next
End Sub
End Module
> What is the elegant way in VB.NET to check whether a windows service is
> installed or not?
>
> How does the service controller tell this?
>
> thanks herbert