Here’s a script I’ve been using on client computers to restart print services on Windows computers and additionally clear the print queue. Drop it in your support folder and optionally make a desktop or other shortcut for users and they can maintain and Restart print services and use this to clear printer queue script. Automation saves time!
The link to our github download is below…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
@echo off @break off @cls setlocal EnableDelayedExpansion REM ----------------------------------- Overview ------------------------------------ REM Original script by: Jonathan Warner REM Updated on: 20200131 REM Updated by: Computer Repair Sacramento REM Filename: wcs_clear-printer-queue.bat REM distributed freely without any warranty or guarantee of suitability of fitness for any purpose! Use at your own risk! REM --------------------------------- Begin Code ------------------------------------ net stop spooler>nul & IF ERRORLEVEL 1 ( set "scriptnotes=Error stopping spooler" goto END ) del %windir%\system32\spool\printers\*.* /F /Q>nul & IF ERRORLEVEL 1 ( set "scriptnotes=Error clearing cache" goto END ) net start spooler>nul & IF ERRORLEVEL 1 ( set "scriptnotes=Error starting spooler" goto END ) set "scriptnotes=Local print cache and queue cleared" cls :END REM ending and housekeeping duties echo %scriptnotes% endlocal exit /b |