Good morning AskPerf world! Jeff Hagler from the Performance team here to chat about printing. How many of you have ever dealt with an issue where you just knew that something was wrong with your print spooler but could not quite put a finger on it? Maybe print jobs were slow, certain users could print to some printers but not others, or maybe nobody could print at all?
Back in the day, we included a tool with the Windows 2003 Resource Kit called Cleanspl that was able to make sure that the spooler service was configured correctly and clear of any third party dependencies that may be referencing bad/missing files. Cleanspl is a great tool, but by being hidden in the resource kit, it was rarely used. Up until now, this tool did not exist/work in recent Operating Systems like Windows Server 2008..
We are happy to announce the same functionality in Cleanspl (and a bit more) has been built into one of our Fixits that will run on Windows XP/2003 and Windows Vista/2008 and can be downloaded from Fixit 9662904.
*UPDATE* As of today (4/24/2013), the Fixit for Windows 7 and Windows Server 2008 R2 is now available!
Related KB Article:
You experience Print Spooler error messages after installing or upgrading a Third-Party print driver
Please Note: All applications must be shut down before running the Fix It Solution. Some applications will open a handle to the print spooler when running and this will prevent any cleanup from occurring. The Fix It Solution will not shut down any applications before the cleanup to prevent loss of data.
This Fixit package consists of two modes: Light and Full. Light will make changes to the spooler that should not require your end user to make any changes, while the Full mode will restore the print spooler to defaults and will require a complete reinstall of your print drivers and printers. Think of the Light version as something you can run on any system (print server, terminal server, normal client system) as a first troubleshooting step, and the Full version as something to reserve for systems that get their printers and print drivers pushed down from Print Servers (via Group Policy and Point and Print). Let’s cover the key part of the previous statement again for Fixit 9662904 – do not run the Full version on a Print Server as it will delete all the printers. Basically, it puts your Print Environment back to the way it was when the OS was installed.
When you first run the Fixit on your system, you will be prompted with the normal installation/licensing agreement screens. You will then receive the dialog box below. To run the Light version, just click Next. To run the Full version, you will need to check the box to “Reset the print spooler to defaults”.
Note the Light version does not require a reboot but the Full version does. Again, do not run the Full version Fixit 9662904 on a Print Server as it will delete all the print drivers and print queues
Here are the details on what actually happens during each of these cleanups:
- Set the print spooler service back to its defaults (automatically start, run as Local System, etc.)
- Remove any dependencies that the spooler may have on 3rd party services
- Delete any print jobs from %windir%\system32\spool\printers (shd and spl files)
- Turn on logging of print errors and warning to the event log (Printers -> File -> Server Properties -> Advanced Tab -> “Log spooler error events” and “Log spooler warning Events” will be checked)
- Make sure the standard print monitors are present (USB, Local Port, and TCPIP) under [HKLM\CurrentControlSet\Control\Print\Monitors] (and WSD on 2008/Vista only)
- Ensure that the winprint print processor is present for the architecture of the computer – for example: [HKLM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors\winprint]
- Start the print spooler service
- If any of the core print spooler binaries are missing (spoolsv.exe, spoolss.dll, localspl.dll, win32spl.dll), the package attempts to copy that file from dllcache – if they aren’t present in dllcachce, we log that in the desktop log file
- If ntprint.inf is missing, we log that to the desktop log file
- If there is a bogus path for the spool directory DefaultSpoolDirectory under [HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers], we log that information to the desktop log file
- Does all of the Light steps first
- Delete *.spl and *.shd files from a non-default spool folder
- Delete *.spl and *.shd files from the default spool folder: %windir%\System32\spool\printers
- Delete printer shares
- Delete per-machine printers from [HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers] (except on Vista do not delete “Microsoft XPS Document Writer” and “Fax”)
- Delete per-machine connections from [HKLM\SYSTEM\CurrentControlSet\Control\Print\Connections] and the “Connections” key itself
- Delete per-user connections under <USER HIVE>\Printers
- Delete Monitors under [HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors] (except Local Port)
- Delete each driver under [HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows <arch>\Drivers\Version-3] (except on Vista don’t delete “Microsoft XPS Document Writer” and “Microsoft Shared Fax Driver”)
- Vista: delete all files under “%windir%\System32\spool\drivers\<arch>\3” except for driver files associated with “Microsoft XPS Document Writer” and “Microsoft Shared Fax Driver”. Ignore subdirectories.
- XP: delete the “%windir%\System32\spool\drivers” folder
- Set back the defaults : [HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers] (AddPrinterDrivers=0)
- Delete [HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\Internet Print Provider\Ports]
- Add back these default values:
- HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\USB Monitor
- HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port
- (XP) HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\BJ Language Monitor
- (XP) HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\PJL Language Monitor
- (Vista) HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\WSD Port
- (If Fax driver was installed) HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\Microsoft Shared Fax Monitor
As you can see the light mode of this tool is a great first pass at troubleshooting a myriad of Print Spooler issues, with minimal risk/downtime for your users. Give it a go and let us know how it works for you.