Created
July 31, 2025 15:38
-
-
Save BladeWDR/e9c89756635ade307f0f76db408e4331 to your computer and use it in GitHub Desktop.
Powershell script to disable Windows Recall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Registry values to set to prevent Recall from renabling itself. | |
| $RecallRegistryValues = @( | |
| [pscustomobject]@{ | |
| Path="HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" | |
| Name="DisableAIDataAnalysis" | |
| Type="DWord" | |
| Value="1" | |
| } | |
| [pscustomobject]@{ | |
| Path="HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" | |
| Name="AllowRecallEnablement" | |
| Type="Dword" | |
| Value="0" | |
| } | |
| [pscustomobject]@{ | |
| Path="HKLM:\SYSTEM\CurrentControlSet\Control\CI\Policy" | |
| Name="VerifiedAndReputablePolicyState" | |
| Type="DWord" | |
| Value="0" | |
| } | |
| ) | |
| filter Assert-RegistryPath | |
| { | |
| $exists = Test-Path -Path "$_" | |
| if(!$exists) | |
| { | |
| Write-Warning "$_ did not exist. Creating key." | |
| $null = New-Item -Path "$_" -ItemType Directory | |
| } | |
| } | |
| $OSType = (Get-CimInstance Win32_OperatingSystem).ProductType | |
| # ProductType works like this: | |
| # 1 - Work Station | |
| # 2 - Domain Controller | |
| # 3 - Server | |
| if ($OSType -gt 1) | |
| { | |
| Write-Error "This script will only work on workstations, not servers. Exiting." | |
| exit 1 | |
| } | |
| try | |
| { | |
| $windowsVersion = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | |
| $displayVersion = $windowsVersion.DisplayVersion | |
| $currentBuild = $windowsVersion.CurrentBuild | |
| $productName = $windowsVersion.ProductName | |
| # Windows 11 starts at build 22000, Windows 10 is below that | |
| $isWindows11 = [int]$currentBuild -ge 22000 | |
| if ($isWindows11) | |
| { | |
| Write-Host "Detected Windows 11 (Build: $currentBuild, Version: $displayVersion)" | |
| } else | |
| { | |
| Write-Host "Detected Windows 10 (Build: $currentBuild). Recall is only available on Windows 11 24H2 and later. No action needed." | |
| exit 0 | |
| } | |
| # Check if it's 24H2 or later (Build 26100+) | |
| if ([int]$currentBuild -lt 26100) | |
| { | |
| Write-Host "Recall requires Windows 11 24H2 (Build 26100) or later. Current build: $currentBuild ($displayVersion). No action needed." | |
| exit 0 | |
| } | |
| Write-Host "Windows 11 24H2+ detected. Proceeding with Recall disable script..." | |
| } catch | |
| { | |
| Write-Warning "Could not determine Windows version. Proceeding with caution: $($_.Exception.Message)" | |
| } | |
| $RecallEnabled = Get-WindowsOptionalFeature -Online -FeatureName Recall | |
| if($RecallEnabled.state -ne "DisabledWithPayloadRemoved") | |
| { | |
| Write-Host "Recall is enabled. Disabling Recall via DISM.exe" | |
| DISM /online /disable-feature /FeatureName:Recall /quiet /norestart | |
| Foreach ($key in $RecallRegistryValues) | |
| { | |
| $key.Path | Assert-RegistryPath | |
| try | |
| { | |
| $currentValue = Get-ItemProperty -Path $key.Path -Name $key.Name -ErrorAction SilentlyContinue | |
| if ($null -eq $currentValue -or $currentValue.($key.Name) -ne $key.Value) | |
| { | |
| Set-ItemProperty -Path $key.Path -Name $key.Name -Value $key.Value -Type $key.Type -Force | |
| Write-Host "Set registry value: $($key.Path)\$($key.Name) = $($key.Value)" | |
| } | |
| } catch | |
| { | |
| # If property doesn't exist, create it | |
| New-ItemProperty -Path $key.Path -Name $key.Name -Value $key.Value -PropertyType $key.Type -Force | |
| Write-Host "Created registry value: $($key.Path)\$($key.Name) = $($key.Value)" | |
| } | |
| } | |
| Write-Host "Recall has been disabled, but you should restart your computer so that it fully applies the changes." | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment