start/stop services programatically

  • Thread starter Thread starter vickaiser1
  • Start date Start date
V

vickaiser1

I am creating a setup project for an application and need to edit the
Metabase.xml file during setup. Does anyone know of a way to stop and
then restart services programatically before and after I edit this
file?

Vic
 
this leads me to a couple of other questions. How can I do this within a C#
method? Also, is there a way to collect the names of the <service>'s that I
need to stop, especially those using the MetaBase.xml file.
 
Simply drag a Windows Service from your server explorer window onto a
webform. This will create a nice simple control on your form and you can
call the start and stop methods on it. You can use the same component
programatically from other classes too. Tip: You may need to use
impersonation to have the necessary permissions to start & stop windows
services.
 
Back
Top