How do we turn on the print spooler service?

How do you programmatically turn off the Windows XP Print Spooler service in C#

  • I need to write a small console app (patch) that turns off the print spooler service, does a few things, then starts the print spooler service. I'd like to write this in C#. Can someone point me in the right direction? Thanks in advance!

  • Answer:

    You can probably do that using the ServiceController class : ServiceController controller = new ServiceController("Spooler"); controller.Stop(); ... controller.Start();

MikeW at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

I suspect you use the ServiceController class to control (i.e. to stop and start) the service whose name is spooler.

ChrisW

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.