@echo off &REM -*-coding:cp850; fill-column:132;-*-
 REM ResetSpooler.cmd
 REM
 REM Windows system administration script to reset the printer spooler.
 REM
 REM You may run this command-file from the Explorer or DOS command-line. In
 REM either case ADMINISTRATOR PRIVILEGES are required.
 REM 
 REM Motivation: There are times when it seems impossible to remove jobs from
 REM the print queue of a particular printer. Windows keeps trying to send the
 REM print job and it becomes impossible to remove the job. This batch-file
 REM attempts to start/stop the printer spooler and delete ALL pending jobs,
 REM UNCONDITIONALLY.
 REM
 REM $Author: Andreas Spindler$
 REM $Maintained at: http://www.visualco.de$
 net stop spooler
 if errorlevel 1 goto noadmin
 set CD_=%CD%
 cd /D %SYSTEMROOT%\System32\Spool\Printers
 if errorlevel 1 cd /D %WINROOT%\System32\SpoolPrinters
 if errorlevel 1 goto nodir
 cd
 if exist *.spl del *.spl
 if exist *.shd del *.shd
 net start spooler
 cd /D %CD_%
 pause
 exit /B 0
:noadmin
 echo Try running this script as an Administrator, so the spooler
 echo service can be stopped.
 pause
 exit /B 1
:nodir
 echo No Spooler directory.
 pause
 exit /B 2