Simplify clearing the Windows Print Spooler Queue

Windows XP Printer folder

Windows uses Print Spooling to store the print jobs (data sent to a printer) in a buffer, allowing the program that sent the data to the printer to resume its normal operation. Basically, it means that your Word Processor need not wait for the file to print before restoring control to the user. You’re free to work on the document while the printer keeps printing.

Spooling also lets users place a number of print jobs in a queue instead of waiting for each one to finish before specifying the next one.

You can always check out your printer’s queue of documents to be printed by opening the printer from within the Printers & Faxes section of the Control Panel in Windows XP (Vista users: Control Panel > Hardware & Sound > Printers)

Windows XP Printer folder

As shown above, the queue contains two documents. Right-clicking displays a context menu showing a few basic choices. Canceling a faulty or misfiring print job can be done from here. A possible scenario to do this would be accidentally printing an entire multi-page document when only certain pages need be printed.

The Printer queue window can also be opened by double-clicking the printer icon which usually appears in the notification area (known to some as the system tray) when a print command has been issued.

Printer icon in the notification area

Of course, windows being windows there are times, when a print job gets stuck, or there’s a paper jam or some set of unknown circumstances causes the printer to stop responding. That’s when you need to restart the Printer Spool Service.

The multi-click method of doing this would be to open the Services window by typing services.msc via the START > RUN command, stopping the Print Spooler service, clearing the pending jobs in the appropriate folder followed by then having to start the Print Spooler service all over again.

You can use the following code in a batch file to carry out this above operation with just a double-click on the batch file.

First open up notepad or your favourite plain-text editor.

Type in the following lines:

net stop spooler
del /F /Q %systemroot%\system32\spool\printers\*.shd
del /F /Q %systemroot%\system32\spool\printers\*.spl
net start spooler

Click FILE > SAVE and give it an appropriate name like “Restart Print Spooler.cmd” and save it on your desktop or to a location of choice.

That’s it! Whenever you need to clear out a print queue or your printer’s misbehaving just double-click the file and watch it work just as intended.

Clear Print Spooler

Download983 downloads

2 Responses to “Simplify clearing the Windows Print Spooler Queue”

  1. David says:

    This is a great tip! I notice that in Windows 7 you may have to run this script as an administrator (by right clicking “run as administrator”). Is there any way to bypass this requirement through an extra line of code in the cmd file?

    • Sparx says:

      You might try using the “runas /user:YOURUSERNAME /savecred” in front of each command. Be warned that the savecred switch is NOT supported in Windows 7 HOME editions. However, this will allow a user to save the password for the rest of the session.

      IMHO, two clicks to run as administrator is a necessary evil, especially if you have UAC enabled.

Leave a Reply

%d bloggers like this: