Information Technology Reference
In-Depth Information
3.
Select the Action menu, and then select one of the following options:
￿ Stop to stop the Print Server service
￿ Start to start the Print Server service
￿ Restart to restart the Print Server service
Using a Command-Line Interface
To stop the Print Spooler service, type the following in the command window:
> net stop spooler
To start the Print Spooler service, type the following in the command window:
> net start spooler
Using VBScript
To stop the Print Spooler service on the local computer, put the following code into a VBS file:
'This code will stop the print spooler service
'---SCRIPT CONFIGURATION ---
strComputer = "."
'---END CONFIGURATION---
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='Spooler'")
For each objService in colServiceList
errReturn = objService.StopService()
Next
WScript.Echo ("Script Complete")
To start the Print Spooler service on the local computer, use the following script:
'This code will start the print spooler service
'---SCRIPT CONFIGURATION---
strComputer = "."
'---END CONFIGURATION---
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='Spooler'")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='Spooler'")
For each objService in colServiceList
errReturn = objService.StartService()
Next
WScript.Echo ("Script Complete")
Search WWH ::




Custom Search