added more reg

This commit is contained in:
poslop
2026-01-14 15:19:58 -06:00
parent 5d929a7ff0
commit 813fc74972
2 changed files with 5 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
$flagFolder = "C:\ProgramData\PrinterHKeyClean"
$flagFile = "${flagFolder}\v1.flag"
$flagFile = "${flagFolder}\v2.flag"
if (!(Test-Path $flagFolder)) {
New-Item -Path $flagFolder -ItemType Directory -Force | Out-Null
@@ -23,6 +23,7 @@ $HKUsersPrinterPaths = @(
$HKLMPrinterPaths = @(
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers',
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\V4 Connections',
'HKEY_LOCAL_MACHINE\SOFTWARE\Xerox\PrinterDriver'
)
@@ -38,8 +39,8 @@ foreach ($HKLMPrinterPaths in $HKLMPrinterPaths) {
}
}
foreach ($sid in $sids) {
$sid = $sid.PSChildName
foreach ($sidItem in $sids) {
$sid = $sidItem.PSChildName
$profilePath = (Get-ItemProperty -Path $sid.PSPath -Name ProfileImagePath).ProfileImagePath
foreach ($HKUsersPrinterPath in $HKUsersPrinterPaths) {