-1

As my client is not accustomed to using the windows services screen, I'm wondering what I do to get the type of startup of a service.

Peter Bons
  • 26,826
  • 4
  • 50
  • 74
Dionatas Firmino
  • 17
  • 1
  • 1
  • 7
  • please check this question: [https://stackoverflow.com/questions/133883/stop-and-start-a-service-via-batch-or-cmd-file](https://stackoverflow.com/questions/133883/stop-and-start-a-service-via-batch-or-cmd-file) – AMINCHAR Feb 25 '18 at 13:46

1 Answers1

1

It is as simple as using the StartType property of the ServiceController class :

ServiceController sc = new ServiceController("Simple Service");
Console.WriteLine(sc.StartType.ToString());

where "Simple Service" is the name of the service you want to get the details of.

More examples of using this class can be found here.

Peter Bons
  • 26,826
  • 4
  • 50
  • 74