Flush Printer Batch File

Posted on Posted in Don't Feed the Technician

This batch file was to help fix an issue a user had where the printer was set to spool on the local users computer (since changed to spool on server) but for what ever reason user could nopt print due to a stuck print job that was locked on deleting print job.

All the user has to do is click the FlushPrinter.bat file and it will stop the spooler service, delete the jobs stuck on the computer spool folder, then will restart the spooler service.

@ECHO OFF
echo Step 1: Stop the Print Spooler
echo ——————————
net stop spooler
echo Done!
echo.

TIMEOUT 5

echo Step 2: Erasing old chaf (junk printer documents)
echo ————————————————-
del /Q /F /S “%systemroot%\System32\Spool\Printers\*.*”
echo Done!
echo.

TIMEOUT 5

echo Step 3: Problems eliminated! Restarting printer services
echo ——————————————————–
net start spooler
echo Spooler has been restarted!
echo.

echo Step 4: Try printing again.

@echo off
pause

The code has been altered to add some “Helpful” prompts for the user to know whats happening, but the batch file can be compressed down to the following:

net stop spooler
del /Q /F /S “%systemroot%\System32\Spool\Printers\*.*”
net start spooler

Leave a Reply

Your email address will not be published. Required fields are marked *