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!
views:
619answers:
3
+1
A:
net start spooler
net stop spooler
http://www.tech-recipes.com/rx/864/windows-service-managing-through-command-line/
Chris Ballance
2009-05-08 18:28:25
A:
I suspect you use the ServiceController
class to control (i.e. to stop and start) the service whose name is spooler
.
ChrisW
2009-05-08 18:34:52
Patch complete. Thanks. Your input sent me to the right place!
MikeW
2009-05-08 21:50:12
+1
A:
You can probably do that using the ServiceController class :
ServiceController controller = new ServiceController("Spooler");
controller.Stop();
...
controller.Start();
Thomas Levesque
2009-05-08 18:36:12