views:

11

answers:

1

Hi,

I need some help with Windows NT-Services. I have some services installed on a remote machine which I need to monitor and control from my local machine.

With the ServiceController Class I can control the service, e.g. starting, stopping and so on. I also get the state of the Service via the ServiceController Class (Running, stopped, ...). But I also need to know the service startup typ (automatic, deactivated, ...).

Anybody some advice?

Thanks

+1  A: 

Do you mean that it's an actual Windows NT machine? As in NT 4.0 or older? If so the following probably won't work, but the following should be supported from Win2000 onwards.

You should be able to get out that information using the WMI class Win32_Service as described here.

Here's a sample showing how to use it from C#.

ho1
The machine is Windows2003 Server. So this works fine. Thanks.
Sascha Hennen