how to check if windows service is installed / VB.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
It's in the System Registry.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
 
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
 
Back
Top