Home All Groups Group Topic Archive Search About
Author
20 Nov 2007 12:59 PM
AMP
I am trying to find the details of all the services that are running
a  machine

I have used

Dim services() As ServiceController
Dim i As Integer
services = System.ServiceProcess.ServiceController.GetServices()
   For i = 0 To services.Length - 1
                    msgbox (services(i).DisplayName)                '
to get the service name
                    msgbox (services(i).Status.ToString)             '
to get the running status
   Next


How do I get the startup Type  (Manual,Automatic,Disabled) ?


In VB.net2005

Author
22 Nov 2007 1:05 PM
Alexander Vasilevsky
You can read registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{ServiceName}\Start  =
2 (Automatic), 3 (Manual), or 4 (Disabled).

http://www.alvas.net  - Audio tools for C# and VB.Net developers


Show quote
"AMP" <al***@penstonall.co.uk> ???????/???????? ? ???????? ?????????:
news:2e7aec67-e52b-4548-928f-74d90c365a91@a28g2000hsc.googlegroups.com...
>I am trying to find the details of all the services that are running
> a  machine
>
> I have used
>
> Dim services() As ServiceController
> Dim i As Integer
> services = System.ServiceProcess.ServiceController.GetServices()
>   For i = 0 To services.Length - 1
>                    msgbox (services(i).DisplayName)                '
> to get the service name
>                    msgbox (services(i).Status.ToString)             '
> to get the running status
>   Next
>
>
> How do I get the startup Type  (Manual,Automatic,Disabled) ?
>
>
> In VB.net2005
>
>
>
>

AddThis Social Bookmark Button