diff --git a/RemoveHKLMPrinters.ps1 b/RemoveHKLMPrinters.ps1 index 783bbc7..366260f 100644 --- a/RemoveHKLMPrinters.ps1 +++ b/RemoveHKLMPrinters.ps1 @@ -14,6 +14,8 @@ $HKLMPrinterPaths = @( 'HKEY_LOCAL_MACHINE\SOFTWARE\Xerox\PrinterDriver' ) +net stop spooler + foreach ($printerPath in $HKLMPrinterPaths) { try { Remove-Item -Path "Registry::$printerPath" -Recurse -Force -ErrorAction Stop @@ -42,4 +44,6 @@ foreach ($sidKey in $sids) { } } +net start spooler + gpupdate /force