diff --git a/RemoveHKeyPrinters.ps1 b/RemoveHKeyPrinters.ps1 index cf64956..9fcc5e3 100644 --- a/RemoveHKeyPrinters.ps1 +++ b/RemoveHKeyPrinters.ps1 @@ -41,8 +41,6 @@ foreach ($HKLMPrinterPaths in $HKLMPrinterPaths) { foreach ($sidKey in $sids) { $sid = $sidKey.PSChildName $profilePath = (Get-ItemProperty -Path $sidKey.PSPath -Name ProfileImagePath).ProfileImagePath - - foreach ($printerPath in $printerPaths) { try { @@ -52,11 +50,6 @@ foreach ($sidKey in $sids) { Write-Host "Error: $($_.Exception.Message)" } } - - - if (-not $mounted) { - $unloadResult = & reg.exe unload "HKU\$sid" 2>&1 - } } try {