[THIN] Re: Print Spooler Service - Script

  • From: "Brian Murphy" <bem9127@xxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Wed, 19 Feb 2003 08:24:24 -0600

Could be large or dead spool files (from bad print driver)....

In the interim it might be a good practice to reboot the spool combined
with a spool file clean.  Here is a simple VBSCript you can schedule
using AT command.  Save this output as spool.vbs and schedule using
"cscript spool.vbs" syntax.

Schedule this to run several times per day.  There might be away to
query the WMIService first for stopped services then restart them but I
have not gotten that far yet with the WMI Scripting.

However, I would use this script combined with the Windows 2000 feature
that allows you to have the service "restart" itself.  Goto
Administrative Tools - Services - Double Click Print Spooler - Recovery
Tab.

Set the autorecover to "Run Program".  In the command line type
"<pathtoscript>\spool.vbs"

This script should only take a few seconds to run each time.  You might
need to modify the path statement for your spool directory.

Murphy
--------------------Start Script (Copy and Past into Notepad - Rename as
spool.vbs)
'This will stop the Spooler then delete Spooled files in Spool Directory
'then start the spooler
'-Murphy
'-----------------------------------------------------------------------
-
strComputer = "."
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
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\WINDOWS\system32\spool\PRINTERS\*.*")
Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where Name='Spooler'")
For each objService in colServiceList
    errReturn = objService.StartService()
Next


 
 
-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Jonathan Neffgen
Sent: Wednesday, February 19, 2003 4:29 AM
To: thin@xxxxxxxxxxxxx


Hi all,

We have a problem at the moment with the Print Spooler service on our
main Citrix server (Win2000 SP3 & MF1.8 SP3).  We have users all over
the world using the server with a variety of printers and are
autocreating printers.

Every so often (more than once per day) the Print Spooler service just
stops and doesn't seem to automatically restart itself, meaning someone
with Administrative rights needs to log in and manually restart the
service.

From searching the web, this looks to be something of a known issue,
however the only "solution" I could find was the script from thethin @
http://www.thethin.net/print.cfm, I'm not really keen on using this as
it's a workaround rather than a fix.

Anyone found the answer to this problem?

Thanks,

Jonathan.

*********************************************************
This Week's Sponsor - Neoware
Now through March 31, 2003
Neoware is offering a Capio 500/Eon Proven 2100 for $299! Click the link
below:
http://www.neoware.com/promocp4a/thinnetban.html
**********************************************************

For Archives, to Unsubscribe, Subscribe or set Digest or Vacation mode
use the below link:
http://thethin.net/citrixlist.cfm

*********************************************************
This Week's Sponsor - Neoware 
Now through March 31, 2003 
Neoware is offering a Capio 500/Eon Proven 2100 
for $299! Click the link below:
http://www.neoware.com/promocp4a/thinnetban.html
**********************************************************

For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm

Other related posts:

  • » [THIN] Re: Print Spooler Service - Script