I have some functions written in VBScript that successfully stop/start the print spooler service. This works great, unless there is some other utility that monitors/controls the spooler service. Currently, my enemy is the Dell utilities that are installed if a printer was configured via the CD that came with the unit - but this could be ANY other utility that manages printers, such as HP, Kyocera, etc.
I've pasted what I have for functions in the code block below. My question, is - would anybody be able to point me in the right direction on where I could get information on resolving my problem?
The print spooler service has no problem restarting by itself. If one of the above mentioned utilities has control of the print spooler service, the original script just hangs (since the spooler service can't stop).
I need to stop (and most likely even disable) any service that has control over the print spooler service as well - if there are any.
objLogFile.WriteLine " Stopping the Print Spooler service."
wshShell.Run "net stop " & PrinterSpoolerService,0,True
Err = objSpoolerService.StopService()
Loop Until Err = 5
objLogFile.WriteLine " Printer Spooler has stopped."
objLogFile.WriteLine " Starting the Print Spooler service."
wshShell.Run "net start " & PrinterSpoolerService,0,True
Err = objSpoolerService.StartService()
Loop Until Err = 10
objLogFile.WriteLine " Printer Spooler has started."