Remove Stuck Jobs from the Printer Queue

Did you ever had a job on your printer queue that just couldn’t be deleted? I find that this happens quite frequently with shared network printers on Windows networks. This stuff can be a pain in the ass, so here is how to deal with these kind of situations. You have to manually clean out the spool folder.

This should be a common knowledge thing, but surprisingly few people know about this so I’m posting it here. This way I can just send this link to people who are having this issue instead of explaining the whole thing from the begging. So if this post is not as condescending toward technological incompetence as usual it’s because I’m kinda targeting this at the lost and clueless. mrgreen

First things first, you will need to do this on the computer which is sharing the printers to the rest of the network. It’s usually going to be the computer to which the printer is attached, or the local File & Printer sharing server. If you do this on the wrong computer it won’t work.

Once you locate the machine that handles the printer sharing, you need to stop the print spooling service. Otherwise we won’t be able to clean out the hanging jobs. This is the service that accepts printing jobs, queues them up, and sends them to the printer. Note that once you stop this service no one on your network will be able to print to the printer in question. Of course since you have a stuck job in there, no one can print anyway so it should not be a big issue. Also note that you will loose all queued jobs if you do this. Here is how you do this:

Pull up your Run box (Windows Key+R) type in cmd and hit Enter. This will bring you to the MS DOS prompt. There type in the following:

net stop spooler

You should get a message saying the spooler stopped successfully. Now we need to clean out the spool folder. This is where windows keeps jobs that haven’t been printed yet.

Call up your Run box again (Windows Key+R) and type in the following:

%SYSTEMROOT%\system32\spool\PRINTERS

This should open a new explorer window. You are likely to see bunch of files in there - some of which may be classified as “Shockwave Objects” by windows. They are actually not Shockwave files but whatever. We don’t care because we will be deleting them. Just remove everything you can see that folder and then close the window. If you can’t delete some of the files, it means that you didn’t stop the spooler properly. Go back and try it again.

This deletes all the jobs on the queue, so you might need to re-send some of the documents that got stuck there waiting. Once the folder is empty go back to your DOS prompt and type in:

net start spooler

Your printer queue should be clean now. If it’s not, you probably did something wrong.

Please note that if you look in your Printers and Faxes folder before you issue the start spooler command you will find that all your printers are missing. Don’t panic - this is normal. They will come back once you start the spooler service.

Alternatively you can use the following batch script:

@echo off
net stop spooler
del /F %SYSTEMROOT%\system32\spool\PRINTERS\*.*
net start spooler

Copy the lines above, paste them into notepad and save it as a .bat or .cmd file. Then just double click to run it when your printer gets stuck.

Update 04/02/2007 08:51:47 PM

Updated the script as per suggestion from Daniel Montero (see the comments).

Related Posts:

  • HP LJ 3055 HPTLBXFX.EXE Issues: One More Time With Feeling
  • Inkjects do not spy on people (yet)
  • Comment Spammers Suck
  • Setting up Dell 3100cn Printer on Kubuntu Gutsy
  • Snow Sux
  • Office Pranks
  • New Server Setup
  • Norton Internet Security is a Piece of Crap
  • tcsd_win32.exe has encountered a problem
  • Hoary to Dapper - Upgrade Log

  • 31 Responses to “Remove Stuck Jobs from the Printer Queue”

    1. Gravatar Daniel Montero MEXICO Says: Reply to this comment

      You should use
      del /F %SYSTEMROOT%\system32\spool\PRINTERS\ *.*
      instead of
      cd %SYSTEMROOT%\system32\spool\PRINTERS
      del /F *.*

      , as if the CD command doesn’t work (eg. current drive D: and System Drive C:), the DEL command that follows would remove your documents !

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    2. Gravatar Luke UNITED STATES Says: Reply to this comment

      Thanks! That’s a very good point.

      I updated the script.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    3. Gravatar B UNITED STATES Says: Reply to this comment

      Excellent post, it helped a lot, works like a charm!

      My English grade thanks you.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    4. Gravatar Luke UNITED STATES Says: Reply to this comment

      Glad I could help B. )

      Posted using Mozilla Firefox Mozilla Firefox 1.5 on SuSE Linux SuSE Linux
    5. Gravatar Michael AUSTRALIA Says: Reply to this comment

      Or if your too lazy to login to the print server
      Note: You need the resourse kit installed locally and must be a domain admin.

      @echo off
      sc \\ stop spooler
      del /F /Q \\\c$\windows\system32\spool\PRINTERS\*.*
      sc \\ start spooler

      Note: /Q suppresses the delete y/n prompt

      Posted using Internet Explorer Internet Explorer 6.0 on Windows Windows XP
    6. Gravatar Luke UNITED STATES Says: Reply to this comment

      Great tip Michael! Thanks!

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.2 on Ubuntu Linux Ubuntu Linux
    7. Gravatar Michael AUSTRALIA Says: Reply to this comment

      *my first post is incorrect….doesnt show the servername, here is the correct syntax*

      Or if your too lazy to login to the print server
      Note: You need the resourse kit installed locally and must be a domain admin.

      @echo off
      sc \\servername stop spooler
      del /F /Q \\servername\c$\windows\system32\spool\PRINTERS\*.*
      sc \\servername start spooler

      Note: /Q suppresses the delete y/n prompt

      Posted using Internet Explorer Internet Explorer 6.0 on Windows Windows XP
    8. Gravatar Luke UNITED STATES Says: Reply to this comment

      Heh.. Yeah, I just noticed this. I initially just eyeballed it and saw familiar syntax so I posted a thank-you reply. )

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    9. Gravatar Steve UNITED STATES Says: Reply to this comment

      Where are these files coming from? I cleaned out the spooler folder last night and this morning it had filled back up with the same type file. Nothing that was sent to the spooler by me. So far only one machine seems to be affected. There must be malware that creates them. I have run spybot and ad-aware in addition to Norton Anti virus with no apparent villian.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    10. Gravatar Luke UNITED STATES Says: Reply to this comment

      I think these files are generated by the spooler during normal activity. You shouldn’t worry about them unless you seem to have stuck jobs on the queue.

      I haven’t heard of any spyware that would jam your printer queue. It doesn’t mean that one does not exist, but it’s more likely it is a network issue (maybe a client is dropping off the wireless in the middle of transmitting a job or something).

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.2 on Ubuntu Linux Ubuntu Linux
    11. Gravatar Steve UNITED STATES Says: Reply to this comment

      First off, the spool service was tying up the CPU when there were no print jobs in the queue nor any recent print activity. One of the affected machines is rarely used to print anything so I am somewhat skeptical that these were legitimately generated by a print command from one of the programs.

      I can rule out dropped signals from wireless as wireless is disabled on all machines. Since the C:\WINDOWS\system32\spool folder is used as a reservoir from which to disseminate printing instruction, I would think that it is unlikely that it would be used by any other machine on the network, though I admit that within the network my security policy on shared folders is very liberal. The Spool folder is not shared. I did recently block spoolsv from accessing the internet in case another program was trying to use it .
      Other than something from my new bidirectional print server or some still operable sub-routine remaining on the two drives that were once C drives, I am at a loss as to the source of the files. After three cleanouts of the spool\PRINTERS folder, the file has remained clean for 3 days but no re-boots. I am keeping my fingers crossed.

      I should add two things: First I am grateful to find the advice here as I had found lots of people with the same problem but no one else with the answer. It was obvious this fix was correct, I wonder that I didn’t think of it myself.
      Two, the batch files and run commands offered seem unnecessarily complex. For all but the geeks among us, it is simpler and perhaps safer to use Administrative Tools>Component Services>Services (Local) to access the Spoolsv process to stop the service and simply navigate to WINDOWS\System32\Spool\PRINTERS and delete all the files there, then restart the service. Most users can easily do this if they have turned on the ‘Show Hidden Files’ option in the View tab under Tools> Folder Options..

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    12. Gravatar Luke UNITED STATES Says: Reply to this comment

      I had some problems with an HP printer software causing 100% CPU usage before. Check out that thread - maybe it applies to your problem too.

      Steve said:

      For all but the geeks among us, it is simpler and perhaps safer to use Administrative Tools>Component Services>Services (Local) to access the Spoolsv process to stop the service and simply navigate to WINDOWS\System32\Spool\PRINTERS and delete all the files there, then restart the service.

      Yes and no. A “double click this icon and wait till it finishes” is sometimes simpler. It all depends on user. Some people I work with would be terrified touching the services.msc console to disable the spooler - but would happily run a script that does this for them.

      Also, being a geek myself, I like batch scripts. mrgreen

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    13. Gravatar Michael AUSTRALIA Says: Reply to this comment

      Yeah!….Go the Scripts!….Yeah!

      Posted using Internet Explorer Internet Explorer 7.0 on Windows Windows XP
    14. Gravatar Dheeren Says: Reply to this comment

      Excellent post, thanks alot

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    15. Gravatar Nemea UNITED STATES Says: Reply to this comment

      Hello!

      I tried this suggestion, and when I get to the folder there are no files to delete. However, when I mouseover the icon in the system tray it still says there is a document pending. Garg!

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    16. Gravatar Luke UNITED STATES Says: Reply to this comment

      Nemea said:

      I tried this suggestion, and when I get to the folder there are no files to delete. However, when I mouseover the icon in the system tray it still says there is a document pending. Garg!

      The job might have been spooled by another computer. Make sure you are at the computer that is sharing out the printers to the network.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    17. Gravatar Michael AUSTRALIA Says: Reply to this comment

      Hey! Thought to add this….
      I had this issue from time to time on a certain printer - the printer was setup on a win2k server - where user connect to it.
      Now this problem was resolved by referencing this great post, but since then I determined a cause (note: this would not apply to all cases outlined, but did to me!)
      The cause was a corrupt printer driver.
      I uninstalled and rebooted, downloaded the same version driver again, setup the printer/queue/share/printing defaults etc again and have not had any issues since.
      This has fixed my issue with blocked queues etc.
      Well worth consideration!

      Posted using Internet Explorer Internet Explorer 7.0 on Windows Windows XP
    18. Gravatar Luke UNITED STATES Says: Reply to this comment

      Michael said:

      The cause was a corrupt printer driver.
      I uninstalled and rebooted, downloaded the same version driver again, setup the printer/queue/share/printing defaults etc again and have not had any issues since.

      Thanks. It is a very good point - if this sort of thing happens regularly, it is probably a good idea to reinstall the driver on the server, and all the network clients.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.3 on Windows Windows XP
    19. Gravatar Shawn Wilson CANADA Says: Reply to this comment

      Thank-you, noble blogger! That stuck job was pissing me off.

      Posted using Mozilla Firefox Mozilla Firefox 1.0.6 on Windows Windows XP
    20. Gravatar Nomi SPAIN Says: Reply to this comment

      I saved ran the script above from my desktop and it actually deleted everything on my desktop except my folders, which really sucks. Just a warning.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.4 on Windows Windows XP
    21. Gravatar Luke UNITED STATES Says: Reply to this comment

      Nomi - make sure that there is no space before *.* in the command:

      del /F %SYSTEMROOT%\system32\spool\PRINTERS\*.*

      I just noticed that for some reason I put a space there and this is indeed what would happen - it would delete stuff in the current folder. I fixed the line in the post so it should be ok to copy and paste it now.

      Sorry for the trouble, and thanks for catching this!

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.2 on Ubuntu Linux Ubuntu Linux
    22. Gravatar Dr.Feelin UNITED STATES Says: Reply to this comment

      Thank you so much for the help.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.4 on Windows Windows XP
    23. Gravatar Philip UNITED STATES Says: Reply to this comment

      Great post. Worked like a charm.

      Posted using Internet Explorer Internet Explorer 7.0 on Windows Windows XP
    24. Gravatar Ryan UNITED STATES Says: Reply to this comment

      This was one of the more helpful items I have found about this topic. I had a problem with this re-occurring with a particular server, and I would use the instructions I found on this site to clear the print queue. I finally found what was causing this to happen time and time again. The folder WINDOWS\System32\Spool\PRINTERS had the read only attribute checked, after I unchecked this it has been three weeks since I had to manually empty this folder of files. Thanks for this post on this blog, I thought that this could help another user to fix the root of the print queue jam. I just found this blog to be helpful, so I wanted to pay it forward.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.11 on Windows Windows XP
    25. Gravatar Rich Says: Reply to this comment

      Great help. thought I was going to have to delete the printer and reinstall.

      Thanks.

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.7 on Windows Windows XP
    26. Gravatar Jonathan UNITED STATES Says: Reply to this comment

      Wow, that was incredibly helpful and yet so simple. You’re right; it should be common knowledge.

      Posted using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista
    27. Gravatar Kristin UNITED STATES Says: Reply to this comment

      Thank you, thank you!! I tried performing your steps in Vista but kept getting a “System 5 Error Access is Denied” error when attempting to stop using the net stop spooler command in run window, but I just went into the Services console (via Administrative Tools in the Control Panel) stopped the “Print Spooler” service, deleted the files located in %SYSTEMROOT%\system32\spool\PRINTERS, restarted the service and it worked like a charm.

      Posted using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista
    28. Gravatar Luke Maciak UNITED STATES Says: Reply to this comment

      @Kristin: Yeah, Vista is a bit different with it’s access protection features. The net command likely doesn’t invoke the privilege escalation dialog, but the services.msc console you used does.

      I’m glad you figured it out. )

      Posted using Mozilla Firefox Mozilla Firefox 2.0.0.16 on Ubuntu Linux Ubuntu Linux
    29. Gravatar monica UNITED STATES Says: Reply to this comment

      When i try to do this it says access denied…..What does that mean?

      Posted using Internet Explorer Internet Explorer 7.0 on Windows Windows Vista
    30. Gravatar Luke Maciak UNITED STATES Says: Reply to this comment

      @monica: It may mean two things:

      1. The spooler service is still running - you probably did not stop it properly
      2. You are not an administrator - try logging in as Administrator

      Posted using Mozilla Firefox Mozilla Firefox 3.0.3 on Windows Windows XP
    31. Gravatar Esther Hoffman UNITED STATES Says: Reply to this comment

      Thanks a lot for this very useful post. It worked perfectly for me in Windows Vista.

      Posted using Mozilla Firefox Mozilla Firefox 3.0.5 on Windows Windows Vista

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <pre lang=""> <em> <i> <strike> <strong>

    [Quote selected]