From 128a769a8c135c39ebf969ec4113b14d5ee8b460 Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:39:51 -0500 Subject: [PATCH] better temp dir method #137 --- RemoveWindowsAi.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 59d3c63..76b8a48 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -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 }