From d9e0bec777f5eaf174d1ad2928770d6140bb47ab Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Mon, 16 Jun 2025 19:10:34 -0400 Subject: [PATCH] Remove Machine Learning Dlls --- RemoveWindowsAi.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 37be55c..bc44fd2 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -385,6 +385,26 @@ foreach ($Path in $packagesPath) { } } +#remove machine learning dlls +$paths = @( + "$env:SystemRoot\System32\Windows.AI.MachineLearning.dll" + "$env:SystemRoot\SysWOW64\Windows.AI.MachineLearning.dll" + "$env:SystemRoot\System32\Windows.AI.MachineLearning.Preview.dll" + "$env:SystemRoot\SysWOW64\Windows.AI.MachineLearning.Preview.dll" +) +foreach ($path in $paths) { + takeown /f $path *>$null + icacls $path /grant administrators:F /t *>$null + try { + Remove-Item -Path $path -Force -ErrorAction Stop + } + catch { + #takeown didnt work remove file with system priv + $command = "Remove-Item -Path $path -Force" + Run-Trusted -command $command + } +} + Write-Status -msg 'Removing Hidden Copilot Installers...' #remove package installers in edge dir #installs Microsoft.Windows.Ai.Copilot.Provider