Instantly Cancel Any Printing Job With A Simple Batch File

Cancelling or deleting a job from the print queue takes ages in Windows. This is a common annoyance, which pretty much anyone who has ever used printers would be familiar with.

Apparently, this occurs because the temporary file created for the print job can’t be deleted while it is still being accessed by Windows. The solution is to manually kill the spoolsv.exe service using Task Manager and delete all job files present in C:WindowsSystem32spoolPRINTERS. Off course, if you need to continue printing you would have to either restart your computer or manually restart the spoolsv.exe service.

The trouble with this solution is that it demands too much work. However, a helpful Reddit user has created a batch file to automate the process. In order to use it you can download the batch file from here or manually copy the following code into Notepad and save it as file_name.bat.

@echo off
echo Stopping print spooler.
echo.
net stop spooler
echo deleting stuff... where? I'm not sure. Just deleting stuff.
echo.
FOR %%A IN (%systemroot%system32spoolprinters*.*) DO DEL %%A
echo Starting print spooler.
echo.
net start spooler

Now, whenever you need to delete all printing jobs, just double click on the batch file. However, be careful while using this in a work environment as if you are on a print server, it would cancel printing jobs for all connected printers.

(via LifeHacker)

,

8 Responses to Instantly Cancel Any Printing Job With A Simple Batch File

  1. NavaPavan March 19, 2010 at 3:04 pm #

    This was nice one to end the task.

  2. Chethan March 20, 2010 at 6:22 am #

    Thanks for The Instant solution :p
    .-= Chethan´s last blog ..Zoozoo Jumping on Trampoline meets Tiger. sms GAME to 111[Vodafone ad] =-.

  3. Ankit March 21, 2010 at 4:42 pm #

    I liked this this code so much that I made an exe based app of this with some more features.. Gonna releae it on my blog soon. BTW post retweeted. :)

  4. Mike May 3, 2010 at 8:55 pm #

    Oh good one! I will be making this a part of my usual batch files taht I use.
    .-= Mike´s last blog ..Send Email From A Batch File =-.

  5. lowongan August 6, 2010 at 12:35 pm #

    nice job to increase salary

  6. used tires January 25, 2011 at 2:32 am #

    Sometimes I can never some of the jobs to cancel, didn’t know in the past why this ws happening, but this batch file will come in handy!

    -Jean

  7. sell textbooks March 3, 2011 at 8:48 pm #

    Wow that is an awesome shortcut, thanks for the info, good thing I am not on a company network either.

  8. emobile_developer August 4, 2012 at 2:11 pm #

    This is indeed helping advice and definitely help to get rid off from such chagrin job. Thanks a lot for bringing such great solution.

More in Tips and Tricks (7 of 28 articles)