The way to find your how-to

View my LinkedIn profile

How to clear the print queue in Windows

There are many methods to clear the print queue (delete all the queued print jobs) in Microsoft Windows. You can do this manually from the command prompt line; you can use services console (services.msc) to stop/start services and then windows explorer to delete files; you can create a batch script; use external applications etc.
I decided to show you two ways to do so: manual and automated, and both should work in any version of Microsoft Windows.

I. Manual

1. Open the command prompt:

  • Go to Start menu -> type cmd.exe in the Search programs and files field

  • Right mouse click on cmd.exe icon and from the menu choose Run as administrator

  • If asked, click Yes button and you should see the black window with command prompt

2. Stop the print spooler:

  • Write the command below and run it by hitting the Enter on your keyboard
    net stop spooler
    

3. Delete the queue files.

  • When the Print Spooler service is stopped, you can delete the full job queue by entering the 2 commands below, confirming each of them by pressing the Enter on your keyboard
    del c:\system32\spool\printers\*.shd
    del c:\system32\spool\printers\*.spl
    

4. Start the Print Spooler again.

  • Enter the command below and press Enter to confirm:
    net start spooler
    

5. Check your print queue but I'm petty sure it is empty if you made the steps above correctly.

II. Automatic

We can automate the process by creating simple batch script. To do it go throught the steps below:

1. Create a blank text document on your desktop:

  • Right click on the desktop -> from the menu choose New -> and then Text Document
  • Double click on Text Document icon that has just been created to open it
  • Type (or copy and paste) the following commands into the document:
    @echo off
    net stop spooler
    del c:\system32\spool\printers\*.shd
    del c:\system32\spool\printers\*.spl
    net start spooler
    
  • Close the document and confirm Yes to save the changes.

2. Rename the filename just created:

  • Right mouse click the file just created and choose Rename from the menu

  • Type the new name, its new extenstion (eg. Print Queue Cleanup.bat) and hit Enter on your keyboard to confirm.
    Don't forget about the .bat at the end of the file name!
  • Confirm by pressing Yes button that you want to change its extention.

3. The icon image should now change to gears.

4. Run the script:

  • Now everytime you want to clean the queue, just right mouse click the created file and select Run as administrator.

Document version: 1.0

Last modified on:

Comments

Orejano
12 Aug 2013, 04:07
i have a batch taken from lifehacker to do just that
but this is something to be careful with since the spool server has a temper of it own

@echo off
echo Stopping Spooler
echo.
net stop spooler
echo Deleting Stuff
echo.
del “%systemroot%\system32\spool\printers\*.shd”
del “%systemroot%\system32\spool\printers\*.spl”
echo Restarting Spooler.
echo.
net start spooler
Emir
15 Aug 2013, 15:34
very useful tnx!
Bogey
01 Sep 2013, 11:21
For XP users, I have a similar batch file, but much simpler. And it has worked every time.
Power off the printer.
create the batch file below, saved at .bat file. (We named ours KillQueue.bat)

net stop spooler
del c:\windows\system32\spool\printers\*.shd
del c:\windows\system32\spool\printers\*.spl
net start spooler

Power on the printer, your print queue should be empty (be sure to Refresh)
Tek9
11 Sep 2013, 11:25
For those creating batch files. Save a line and del c:\%winroot%\system32\spool\printers\*.* There shouldn’t be anything in that folder besides print jobs, thus all can be deleted.
Little John
01 Oct 2013, 17:42
I like using a batch file to clear out my print queue.
Here is my version of a batch file.

Rem Stop the print spooler service
@echo off
echo Stopping Print Spooler
net stop spooler
echo
if errorlevel 1 echo error: Could not stop spooler.
echo
echo Erasing junk printer files
del /Q /F /S “%systemroot%\System32\Spool\Printers\*.*”
echo Done!!
Rem Restart the print spooler
echo Restarting Print Spooler
echo
net start spooler
if errorlevel 1 goto nospoolerstart
echo
echo Try printing again
echo
echo Press any key to exit
Pause
exit

Since I use only Windows 7, will this batch file work on other versions I don’t know. Major note, you have to run the CMD by right click and run as administrator or the batch will error out.

:nospoolerstart
echo error: could not start the spooler, something wrong.
ilusha
07 Nov 2013, 02:11
Great tip.Thanks :-)
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 
 
Powered by Scriptsmill Comments Script