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.
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.
Updated the script as per suggestion from Daniel Montero (see the comments).
Related Posts:
April 2nd, 2007 at 6:28 pm (3699) [Quote]
You should use
del /F %SYSTEMROOT%\system32\spool\PRINTERS\ *.*instead of
cd %SYSTEMROOT%\system32\spool\PRINTERSdel /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 usingApril 2nd, 2007 at 8:52 pm (3702) [Quote]
Thanks! That’s a very good point.
I updated the script.
Posted usingApril 5th, 2007 at 1:30 am (3730) [Quote]
Excellent post, it helped a lot, works like a charm!
My English grade thanks you.
Posted usingApril 5th, 2007 at 11:56 am (3827) [Quote]
Glad I could help B.
Posted usingApril 10th, 2007 at 3:07 am (4029) [Quote]
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 usingApril 10th, 2007 at 10:03 am (4042) [Quote]
Great tip Michael! Thanks!
Posted usingApril 10th, 2007 at 8:05 pm (4051) [Quote]
*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 usingApril 10th, 2007 at 8:11 pm (4052) [Quote]
Heh.. Yeah, I just noticed this. I initially just eyeballed it and saw familiar syntax so I posted a thank-you reply.
Posted usingApril 23rd, 2007 at 2:09 am (4221) [Quote]
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 usingApril 23rd, 2007 at 12:06 pm (4225) [Quote]
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 usingApril 25th, 2007 at 12:51 am (4239) [Quote]
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.
Posted usingTwo, 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..
April 25th, 2007 at 2:13 am (4240) [Quote]
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:
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.
Posted usingApril 26th, 2007 at 12:18 am (4243) [Quote]
Yeah!….Go the Scripts!….Yeah!
Posted usingMay 2nd, 2007 at 9:28 am (4283) [Quote]
Excellent post, thanks alot
Posted usingMay 10th, 2007 at 8:14 pm (4349) [Quote]
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 usingMay 10th, 2007 at 10:24 pm (4350) [Quote]
Nemea said:
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 usingMay 10th, 2007 at 10:48 pm (4351) [Quote]
Hey! Thought to add this….
Posted usingI 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!
May 10th, 2007 at 11:11 pm (4352) [Quote]
Michael said:
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 usingMay 20th, 2007 at 10:06 am (4429) [Quote]
Thank-you, noble blogger! That stuck job was pissing me off.
Posted usingJune 7th, 2007 at 4:25 am (4711) [Quote]
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 usingJune 7th, 2007 at 1:14 pm (4714) [Quote]
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 usingJune 26th, 2007 at 9:30 pm (4977) [Quote]
Thank you so much for the help.
Posted usingNovember 29th, 2007 at 12:56 pm (7169) [Quote]
Great post. Worked like a charm.
Posted usingDecember 28th, 2007 at 11:13 am (7510) [Quote]
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 usingJanuary 1st, 2008 at 3:25 pm (7558) [Quote]
Great help. thought I was going to have to delete the printer and reinstall.
Thanks.
Posted usingAugust 4th, 2008 at 6:25 pm (9768) [Quote]
Wow, that was incredibly helpful and yet so simple. You’re right; it should be common knowledge.
Posted usingSeptember 8th, 2008 at 2:43 pm (10096) [Quote]
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 usingSeptember 8th, 2008 at 2:57 pm (10097) [Quote]
@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 usingOctober 5th, 2008 at 2:47 pm (10321) [Quote]
When i try to do this it says access denied…..What does that mean?
Posted usingOctober 5th, 2008 at 3:36 pm (10322) [Quote]
@monica: It may mean two things:
1. The spooler service is still running - you probably did not stop it properly
Posted using2. You are not an administrator - try logging in as Administrator
January 7th, 2009 at 4:31 pm (11188) [Quote]
Thanks a lot for this very useful post. It worked perfectly for me in Windows Vista.
Posted using