Created
February 18, 2019 10:43
-
-
Save pcrockett-pathway/83a3bf09ef26c586b91909ebf9759fea to your computer and use it in GitHub Desktop.
Reset print spool service when your printer queue gets stuck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -RunAsAdministrator | |
| [CmdletBinding()] | |
| param() | |
| $ErrorActionPreference = "Stop" | |
| Set-StrictMode -Version 5.0 | |
| # From https://help.logmein.com/articles/en_US/FAQ/How-do-I-clear-the-print-queue-if-a-document-is-stuck-en1 | |
| Stop-Service Spooler | |
| $spoolContents = Join-Path $env:windir "System32\spool\PRINTERS\*" | |
| Remove-Item $spoolContents | |
| Start-Service Spooler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment