Reset and Clear Print Spooler in Windows 10  

    Reset and Clear Print Spooler in Windows 10

    Reset and Clear Print Spooler in Windows 10

    How to Reset and Clear Print Spooler in Windows 10
    Published by Category: Hardware & Drivers
    04 Sep 2023
    Designer Media Ltd

    How to Reset and Clear Print Spooler in Windows 10


    The primary component of the printing interface is the print spooler. The print spooler is an executable file that manages the printing process. Management of printing involves retrieving the location of the correct printer driver, loading that driver, spooling high-level function calls into a print job, scheduling the print job for printing, and so on.

    A printer spooler enables storing multiple print jobs within a print queue where it’s retrieved by the printer or print server. Print jobs are stored in a queue at the speed of the computer, then retrieved and printed at the speed of the printer. Multiple processes can send print jobs to the spool without waiting, and can then perform other tasks, while the "spooler" process operates the printer.

    If you have a stuck print job in the print queue, you can clear and reset the print spooler to remove the stuck print job.

    This tutorial will show you how to reset and clear the print spooler to remove print jobs in Windows 10 and Windows 11.

    You must be signed in as an administrator to reset and clear the print spooler.



    Contents

    • Option One: To Reset and Clear Print Spooler using a BAT file
    • Option Two: To Reset and Clear Print Spooler in Command Prompt






    OPTION ONE

    To Reset and Clear Print Spooler using a BAT file


    1 Click/tap on the Download button below to download the .bat file below.

    Reset_and_clear_print_spooler.bat

    Download

    2 Save the .bat file to your desktop.

    3 Unblock the .bat file.

    4 Run the .bat file.

    5 When prompted by UAC, click/tap on Yes to approve the .bat file to run as administrator.

    6 You will now see a command prompt flash and quickly open and close to reset and clear the print spooler.






    OPTION TWO

    To Reset and Clear Print Spooler in Command Prompt


    1 Open an elevated command prompt.

    2 Enter the commands below into the elevated command prompt one at a time, and press Enter after each command. (see screenshot below)

    net stop spooler

    DEL /F /S /Q %systemroot%\System32\spool\PRINTERS\*

    net start spooler

    3 When finished, you can close the elevated command prompt if you like.

    Reset and Clear Print Spooler in Windows 10-clear_print_spooler_command.png


    That's it,
    Shawn Brink






  1. Posts : 1
    Windows 10 Pro
       #1

    Shawn's method works, but I think there is an easier (1-click) way. I cobbled this together from web research, so I don't deserve any credit (except perhaps for creative laziness).

    From Windows 10 PowerShell, I created a ps1 file with two commands in it:
    net stop spooler
    net start spooler

    Then I created a batch file with a single command in it:
    PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Unrestricted -File ""c:\users\[insert your username]\[insert the path to the ps1 file]\PrintSpooler.ps1""' -Verb RunAs}";

    Then, because I really am lazy, I created a batch file that I could attach to the Quick Launch bar:
    explorer.exe "C:\Users\[insert your username]\[insert the path to the ps1 file]\Print Spooler.bat"

    You can then simply left-click on the Quick Launch bar icon for that last file, and your print spooler will reset. You need not invoke administrator level. This method does not seem to require the second line of code from the Administrator Command Prompt box above, although wiser heads than mine (not hard to find those) may say that I'm just accumulating worthless files by not dumping them. If that turns out to be the case, edit the ps1 file to insert the suggested command.

    I am sure that in the fullness of time, Microsoft will come up with something so that this fix does not work, because that's what Microsoft does. But it works for now.
      My Computer


  2. Posts : 68,844
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    Thank you for the addition WTig3ner, and welcome to Ten Forums. :)
      My Computers


  3. Posts : 1,753
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #3

    I use the same commands but wrapped in an AutoHotkey script which takes care of the elevation and provides an onscreen message:

    Reset and Clear Print Spooler in Windows 10-clear_print_queue.jpg

    Code:
    ; Based on https://autohotkey.com/boards/viewtopic.php?f=6&t=24987&hilit=print+queue
    #SingleInstance force ; Ensure only one instance at a time
    #NoTrayIcon ; Surpress the default Notification tray icon
    
    ; Prompt to 'Run as Admin', i.e. show UAC dialog
    If Not A_IsAdmin
    {
       Run *RunAs "%A_ScriptFullPath%"  ; Requires AHK v1.0.92.01+
       ExitApp
    }
    
    SplashImage,, W300 H120,, `nPlease wait...`n`nThe Printer queue is being cleared.`n`n This may take up to 10 seconds., Clear Printer Queue ; Show user message to inform what's happening
    Runwait, %comspec% /c "net stop spooler",, hide ; Stop the Print Spooler
    
    ; Windows has its Print Queue located at the path used below.
    Runwait, %comspec% /c "del C:\Windows\System32\spool\printers\* /Q /F /S",, hide ;  Delete all files in the Print Queue (using [Q]uiet mode, [F]orce and clear [S]ub-folders switches)
    
    Runwait, %comspec% /c "net start spooler",, hide ; Restart the Print Spooler
    splashimage, off ; Close the information message
    
    ExitApp

    I've added this as a right-click option using a REG file:
    Reset and Clear Print Spooler in Windows 10-clear-print-queue.jpg

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Clear Print Queue]
    "Icon"="C:\\Windows\\System32\\shell32.dll,222"
    "MUIVerb"="Clear Print Queue"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Clear Print Queue\command]
    @="explorer /root,\"C:\\Support\\ClearPrinterQueue.ahk\""

    Hope this helps...
    _______________________________________________________________
    EDIT: Despite this being a very old post (6 years!), someone left me the following visitor message 2 weeks ago asking me about my post (Hint: Don't send me visitor messages. I don't usually notice them):

    very interested in this but trying hard to understand the instructions.

    I've downloaded & installed AutoHotkey and that's not making much sense either.

    As far as I can see, you've not assigned clearance of the print spooler to a key (i.e. made a hotkey).

    As I understand it, the script is written in notepad and then saved with a .ahk file extension for importing into AutoHotkey - what then?

    Also, struggling to understand where your additional command appears.

    When I go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell there is no Clear key - do I therefore create a registry key called 'Clear Print Queue' and if so, how? I right click on 'Shell' then 'New' and select Key what do I do next? Similarly for the second registry key.

    I'd like to understand how these commands work.
    All good questions so I'm going to answer them briefly one-by-one then do a step-by-step 'how to' then a 'how it works'.

    I've downloaded & installed AutoHotkey and that's not making much sense either.
    The AutoHotkey.exe executable is the script interpreter for AHK scripts. Once installed, AutoHotkey assigns itself a file association with text files ending with a .AHK file extension. Just install AutoHotkey then forget about it. Note: Although AutoHotkey is now at version 2, I'm still using version 1.1 (version 1.1.37.01 to be exact). I have no idea whether my .AHK script works with version 2 nor am I going to test it (because I haven't had a printer for the last 2 years).

    As far as I can see, you've not assigned clearance of the print spooler to a key (i.e. made a hotkey).
    Correct. Instead I call the .AHK script from the Windows desktop using Explorer's right-click context menu.

    As I understand it, the script is written in notepad and then saved with a .ahk file extension for importing into AutoHotkey - what then?
    Almost correct. You can use Notepad... but it's not very helpful. You'll find using a dedicated AHK script editor much easier to use. I use SciTE4AutoHotkey. It's a small, free IDE that lets you write, test/run, debug .AHK scripts. Yes, you save the text file scripts with a .AHK file extension. You don't actually 'import' the script into AutoHotkey... just call the script somehow - like double-clicking on the script file - and, because of the file association, that will, in turn, call the script interpreter.

    Also, struggling to understand where your additional command appears.
    I could have just 'run' the .AHK script by double-clicking on it or creating a shortcut to it but I decided instead to use the Windows shell - Explorer.exe - by adding a command to Explorer's right-click context menu. This way I could just right-click on a blank area of the Windows desktop to run the .AHK script from a shell icon

    When I go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell there is no Clear key - do I therefore create a registry key called 'Clear Print Queue' and if so, how? I right click on 'Shell' then 'New' and select Key what do I do next? Similarly for the second registry key.
    You could do, but it's easier just merging a .REG file. I'll add one to this post.

    Basically there's 2 parts to this - the first is to create the .AHK script and the second is to create the right-click context menu entry. To make it easier I've attached a ZIP file called ClearPrinterQueue.zip containing both the .AHK script and a .REG file to create the menu entry.

    Here's how to use.
    1. Use File Explorer to create a folder in the root of C: called Support.
    2. Download the .ZIP file to C:\Support, right-click on it and unblock it then unzip the contents - ClearPrinterQueue.ahk and ClearPrinterQueue.reg.
    3. Double-click on the ClearPrinterQueue.reg file and merge it into the registry. This will create the right-click Explorer context menu entry giving it a standard shell icon and a description of 'Clear Print Queue'. If you get an error merging it then it means you don't have the necessary rights to write to the HKLM hive. In this case, use Search (next to the Start button) for Registry Editor, right-click on the 'found' result, choose Run as administrator then use File > Import... to import the .REG file.

    That's it. The change should be dynamic but if you right-click on a blank area of the desktop and cannot see the new Clear Print Queue entry then restart your device.

    Here's how it works once you've carried out steps 1-3 above.
    a. You right-click on a blank area of the desktop and select the new Clear Print Queue entry.
    b. The ClearPrinterQueue.ahk script stored in the C:\Support folder is called and runs using the AutoHotkey.exe command interpreter (because of the file association with .AHK files).
    c. The command interpreter processes the script line-by-line, first popping up a UAC prompt so the script runs 'as administrator'.
    d. A 'User Information' message appears to show what's happening.
    e. The Windows CMD command processor is called 3 times (with the necessary 'admin' privileges) to first stop the print spooler service, then to clear the print queue then to re-start the print spooler service.
    f. The 'User Information' message is closed and the script terminates.

    https://www.tenforums.com/attachment...interqueue.zip

    Hope this helps...
    Last edited by RickC; 17 Feb 2024 at 10:59.
      My Computer


 

Tutorial Categories

Reset and Clear Print Spooler in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:48.
Find Us




Windows 10 Forums