Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically Stop\Start Print Spooler

Status
Not open for further replies.

BenSC

Technical User
Jul 24, 2001
43
GB
Dear All,
I'm working on an application to automatically map the many printers that we use at work. I have succeeded in mapping the printers, but they don't appear until the print spooler is restarted.

Does anyone know how to automatically stop\start the print spooler in VB.Net 2003?

Any help would be greatly appreciated.

Regards
Ben Cooper
 
Dear BenSC,

Try to use "ServiceController Class" found in "System.ServiceProcess Namespace". It represents a Windows service and allows you to connect to a running or stopped service, manipulate it, or get information about it.

You can use the ServiceController class to connect to and control the behavior of existing services. When you create an instance of the ServiceController class, you set its properties so it interacts with a specific Windows service. You can then use the class to start, stop, and otherwise manipulate the service.

Regards,
ComputerJin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top