PowerShell: clear a stuck print queue
The script
Stop the Spooler service, delete everything in C:\Windows\System32\spool\PRINTERS, start the Spooler again. This clears every queued job on the machine, which is almost always what you want by the time someone has called about it.
Stop-Service -Name Spooler -Force
Remove-Item -Path "$env:SystemRoot\System32\spool\PRINTERS\*" -Force -ErrorAction SilentlyContinue
Start-Service -Name Spooler
Notes before you run it
- This deletes every pending job for every user on the machine, not just the stuck one.
- If the Spooler stops again immediately, a corrupt driver is usually to blame; check Event Viewer under
Applications and Services Logs / Microsoft / Windows / PrintService. - Recurring stuck queues on a print server deserve a driver update rather than a scheduled version of this script.
Run it on every machine, not one at a time.
Save any of these as a command in Moorfox and run it on a machine in one click, output and exit code captured, with no PSRemoting or WinRM setup. The agent runs it locally and reports back, even over the internet.