From ed029df314899fcafd142d8ff8f8de226e83f1fa Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Wed, 5 Jun 2024 09:17:24 +0200 Subject: [PATCH] Added option to disable Windows Recall AI snapshots (#61) Removed code for migrating LastSettings file to SavedSettings --- Get.ps1 | 1 + Menus/Info | 1 + README.md | 4 +++- Regfiles/Disable_AI_Recall.reg | 7 +++++++ Regfiles/Undo/Enable_AI_Recall.reg | 10 ++++++++++ Win11Debloat.ps1 | 30 ++++++++++++++---------------- 6 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 Regfiles/Disable_AI_Recall.reg create mode 100644 Regfiles/Undo/Enable_AI_Recall.reg diff --git a/Get.ps1 b/Get.ps1 index 65d7da2..b8a96da 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -22,6 +22,7 @@ param ( [switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb, [switch]$HideTaskview, [switch]$DisableCopilot, + [switch]$DisableRecall, [switch]$DisableWidgets, [switch]$HideWidgets, [switch]$DisableChat, diff --git a/Menus/Info b/Menus/Info index 603254d..670590a 100644 --- a/Menus/Info +++ b/Menus/Info @@ -28,6 +28,7 @@ through all the settings yourself, or removing apps one by one! - Disable & remove bing search & cortana in Windows search. - Disable tips, tricks, suggestions and ads in start, settings, notifications, windows explorer, and on the lockscreen. - Disable Windows Copilot. (Windows 11 build 22621+) +- Disable Windows Recall snapshots. (Windows 11 build 22621+) - Restore the old Windows 10 style context menu. (Windows 11 build 22000+) - Show hidden files, folders and drives. - Show file extensions for known file types. diff --git a/README.md b/README.md index c07f5de..0de2b32 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,10 @@ You can pick and choose exactly which modifications you want the script to make, - Disable telemetry, diagnostic data, app-launch tracking & targeted ads. - Disable tips, tricks, suggestions and ads in start, settings, notifications, Windows explorer, and on the lockscreen. -#### Bing & Copilot +#### Bing, Copilot & More - Disable & remove bing search & cortana in Windows search. - Disable Windows Copilot. (Windows 11 only) +- Disable Windows Recall snapshots. (Windows 11 only) #### Windows Explorer - Show hidden files, folders and drives. @@ -297,6 +298,7 @@ The quick and advanced method support parameters to tailor the behaviour of the | -ShowSearchBoxTb | Show search box on the taskbar. (Windows 11 only) | | -HideTaskview | Hide the taskview button from the taskbar. (Windows 11 only) | | -DisableCopilot | Disable Windows copilot. (Windows 11 only) | +| -DisableRecall | Disable Windows Recall snapshots. (Windows 11 only) | | -DisableWidgets | Disable the widget service & hide the widget (news and interests) icon from the taskbar. | | -HideChat | Hide the chat (meet now) icon from the taskbar. | | -HideOnedrive | Hide the onedrive folder in the Windows explorer sidepanel. (Windows 10 only) | diff --git a/Regfiles/Disable_AI_Recall.reg b/Regfiles/Disable_AI_Recall.reg new file mode 100644 index 0000000..b04dafe --- /dev/null +++ b/Regfiles/Disable_AI_Recall.reg @@ -0,0 +1,7 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsAI] +"DisableAIDataAnalysis"=dword:00000001 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsAI] +"DisableAIDataAnalysis"=dword:00000001 \ No newline at end of file diff --git a/Regfiles/Undo/Enable_AI_Recall.reg b/Regfiles/Undo/Enable_AI_Recall.reg new file mode 100644 index 0000000..5a795c3 --- /dev/null +++ b/Regfiles/Undo/Enable_AI_Recall.reg @@ -0,0 +1,10 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\WindowsAI\DisableAIDataAnalysis] +"value"=dword:00000000 + +[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsAI] +"DisableAIDataAnalysis"=- + +[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsAI] +"DisableAIDataAnalysis"=- \ No newline at end of file diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index ba754ce..2a9d512 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -23,6 +23,7 @@ param ( [switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb, [switch]$HideTaskview, [switch]$DisableCopilot, + [switch]$DisableRecall, [switch]$DisableWidgets, [switch]$HideWidgets, [switch]$DisableChat, @@ -544,22 +545,9 @@ foreach ($Param in $SPParams) { } } -# Check if SavedSettings file exists, if it doesn't exist check if LastSettings file exists -if (Test-Path "$PSScriptRoot/SavedSettings") { - if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) { - # Remove SavedSettings file if it's empty - Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse - } -} -elseif (Test-Path "$PSScriptRoot/LastSettings") { - if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/LastSettings"))) { - # Remove LastSettings file if it's empty - Remove-Item -Path "$PSScriptRoot/LastSettings" -recurse - } - else { - # Rename LastSettings file to SavedSettings if it isn't empty - Rename-Item -Path "$PSScriptRoot/LastSettings" -NewName "$PSScriptRoot/SavedSettings" - } +# Remove SavedSettings file if it exists and is empty +if (Test-Path "$PSScriptRoot/SavedSettings" -and [String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) { + Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse } # Only run the app selection form if the 'RunAppConfigurator' parameter was passed to the script @@ -752,6 +740,12 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP if ($( Read-Host -Prompt "Disable Windows Copilot? This applies to all users (y/n)" ) -eq 'y') { AddParameter 'DisableCopilot' 'Disable Windows copilot' } + + Write-Output "" + + if ($( Read-Host -Prompt "Disable Windows Recall snapshots? This applies to all users (y/n)" ) -eq 'y') { + AddParameter 'DisableRecall' 'Disable Windows Recall snapshots' + } } # Only show this option for Windows 11 users running build 22000 or later @@ -1131,6 +1125,10 @@ else { RegImport "> Disabling Windows copilot..." $PSScriptRoot\Regfiles\Disable_Copilot.reg continue } + 'DisableRecall' { + RegImport "> Disabling Windows Recall snapshots..." $PSScriptRoot\Regfiles\Disable_AI_Recall.reg + continue + } {$_ -in "HideWidgets", "DisableWidgets"} { RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Widgets_Taskbar.reg continue