mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2026-02-06 05:36:54 +01:00
better temp dir method #137
This commit is contained in:
@@ -842,11 +842,12 @@ Windows Registry Editor Version 5.00
|
||||
'@
|
||||
}
|
||||
|
||||
New-Item "$env:TEMP\DisableAIPhotos.reg" -Value $regContent -Force | Out-Null
|
||||
regedit.exe /s "$env:TEMP\DisableAIPhotos.reg"
|
||||
$tempDir = ([System.IO.Path]::GetTempPath())
|
||||
New-Item "$($tempDir)DisableAIPhotos.reg" -Value $regContent -Force | Out-Null
|
||||
regedit.exe /s "$($tempDir)DisableAIPhotos.reg"
|
||||
Start-Sleep 1
|
||||
reg unload HKU\TEMP >$null
|
||||
Remove-Item "$env:TEMP\DisableAIPhotos.reg" -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item "$($tempDir)DisableAIPhotos.reg" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user