better temp dir method #137

This commit is contained in:
zoicware
2026-01-20 12:39:51 -05:00
committed by GitHub
parent 148b91226b
commit 128a769a8c

View File

@@ -842,11 +842,12 @@ Windows Registry Editor Version 5.00
'@ '@
} }
New-Item "$env:TEMP\DisableAIPhotos.reg" -Value $regContent -Force | Out-Null $tempDir = ([System.IO.Path]::GetTempPath())
regedit.exe /s "$env:TEMP\DisableAIPhotos.reg" New-Item "$($tempDir)DisableAIPhotos.reg" -Value $regContent -Force | Out-Null
regedit.exe /s "$($tempDir)DisableAIPhotos.reg"
Start-Sleep 1 Start-Sleep 1
reg unload HKU\TEMP >$null reg unload HKU\TEMP >$null
Remove-Item "$env:TEMP\DisableAIPhotos.reg" -Force -ErrorAction SilentlyContinue Remove-Item "$($tempDir)DisableAIPhotos.reg" -Force -ErrorAction SilentlyContinue
} }