Home All Groups Group Topic Archive Search About

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

Author
28 Jan 2006 11:28 PM
herbert
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

Author
29 Jan 2006 2:23 PM
Kevin Spencer
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.

Show quote
"herbert" <herb***@discussions.microsoft.com> wrote in message
news:9A42EA84-C7FC-40DC-8795-12FE9B5BCDB6@microsoft.com...
> 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
Author
30 Jan 2006 2:09 AM
John Galt
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

Show quote
"herbert" <herb***@discussions.microsoft.com> wrote in message
news:9A42EA84-C7FC-40DC-8795-12FE9B5BCDB6@microsoft.com...
> 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

AddThis Social Bookmark Button