views:

77

answers:

2

I'm using VB 9 (VS2008).

I would like to know how to do the control Windows Services through an Windows Forms application.

I want to know:

  1. How to determine the status of a service?
  2. How to change the Startup type of the service?
  3. How to start, stop, pause and resume a service?

Thank you!

A: 

I'm pretty sure that (unless they changed stuff recently) you'll have to do this either through p/invoke's or through WMI.

Wow, how did I forget about that class.

Joe
+4  A: 

The framework class ServiceController allows you to do all of these things.

Matt Brunell
You didn't mention anything about how to change the start up type...