Clear print queue command line sequence

Here’s an old, old, but still useful tip that works on all NT-based versions of Windows (including Windows 7 and Windows 10). This is the clear print queue command line sequence for Windows, and it’s the fastest, most reliable way to recover from a hung print job. It works from the standard Windows CMD prompt.

The sequence is to stop the spooler service, delete the contents of the spooler directory (usually c:\windows\system32\spool\printers\) and then restart the spooler service.

The clear print queue command line sequence

clear print queue command line sequence
If your printer won’t print because some job is stuck in the print queue, you need my magic 3-command clear print queue command line sequence.

Open a command prompt (CMD.EXE), and issue these three commands:

net stop spooler
del /q c:\windows\system32\spool\printers\*
net start spooler

If you have your printers folder open while you issue this command sequence, you’ll see your stuck print jobs disappear, like magic.

If you’ve moved your print spooler to a ramdisk, like I recommend, or to another drive like some government agencies do, substitute that directory for c:\windows\system32\spool\printers in the second line.

How it works

The spooler service locks the content of the spooler directory, keeping you from deleting the files. When you stop the service, you can safely delete the files. Stopping the service, deleting the files, and restarting the service is much faster than the method Windows uses through the GUI.

The downside is it deletes every job in the queue, rather than individual jobs. But sometimes clearing the whole queue quickly is what you want, especially if you don’t know for certain which job is hanging you up. Or if there’s only one job and you want to clear it fast.

One more tip

When you have a print job that’s stuck and keeping you from using your printer, this clear print queue command line sequence will get rid of it more reliably than any other method. It’s fast. It’s less infuriating than right-clicking on a hung print job and then waiting 15 minutes for it to finally disappear. If you find yourself doing this a lot, you might want to save it as a batch file and keep it someplace handy. It will help you get back to work quickly.

Further reading

I’ve collected most of my scripting resources in a single post about scripting Windows sysadmin tasks.

%d bloggers like this:
WordPress Appliance - Powered by TurnKey Linux