From d42019ccc0a9ec75b56164195fefed52f82454de Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:08:47 +0100 Subject: [PATCH] Add option to turn off `Enhance Pointer Precision` #197 --- Assets/Menus/Info | 3 +- Get.ps1 | 7 +- README.md | 10 +- .../Disable_Enhance_Pointer_Precision.reg | 6 + .../Disable_Enhance_Pointer_Precision.reg | 6 + .../Undo/Enable_Enhance_Pointer_Precision.reg | 6 + Win11Debloat.ps1 | 792 +++++++++--------- 7 files changed, 434 insertions(+), 396 deletions(-) create mode 100644 Regfiles/Disable_Enhance_Pointer_Precision.reg create mode 100644 Regfiles/Sysprep/Disable_Enhance_Pointer_Precision.reg create mode 100644 Regfiles/Undo/Enable_Enhance_Pointer_Precision.reg diff --git a/Assets/Menus/Info b/Assets/Menus/Info index 259c476..c888a5d 100644 --- a/Assets/Menus/Info +++ b/Assets/Menus/Info @@ -44,7 +44,8 @@ Context menu - Hide the 'Include in library', 'Give access to' & 'Share' options from the context menu. (W10 only) Other -- Disable Xbox game/screen recording. (Also stops gaming overlay popups) +- Disable Xbox game/screen recording, this also stops gaming overlay popups. +- Turn off Enhance Pointer Precision, also known as mouse acceleration. - Sysprep mode to apply changes to the Windows Default user profile. ------------------------------------------------------------------------------------------- diff --git a/Get.ps1 b/Get.ps1 index 5e83c47..eb85c85 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -27,13 +27,12 @@ param ( [switch]$DisableStartRecommended, [switch]$DisableCopilot, [switch]$DisableRecall, - [switch]$DisableWidgets, - [switch]$HideWidgets, - [switch]$DisableChat, - [switch]$HideChat, + [switch]$DisableWidgets, [switch]$HideWidgets, + [switch]$DisableChat, [switch]$HideChat, [switch]$ClearStart, [switch]$ClearStartAllUsers, [switch]$RevertContextMenu, + [switch]$DisableMouseAcceleration, [switch]$HideHome, [switch]$HideGallery, [switch]$ExplorerToHome, diff --git a/README.md b/README.md index c1e4d15..f012ead 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,8 @@ The script also includes many features that system administrators will enjoy. Su #### Other -- Disable Xbox game/screen recording. (Also stops gaming overlay popups) +- Disable Xbox game/screen recording, this also stops gaming overlay popups. +- Turn off Enhance Pointer Precision, also known as mouse acceleration. - Sysprep mode to apply changes to the Windows Default user profile. ### Default Settings @@ -312,11 +313,14 @@ The quick and advanced usage methods support switch parameters. A table of all t | -ClearStart | Remove all pinned apps from start for the current user (Windows 11 update 22H2 or later only) | | -ClearStartAllUsers | Remove all pinned apps from start for all existing and new users. (Windows 11 update 22H2 or later only) | | -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. | -| -DisableBing | Disable & remove Bing web search, Bing AI & Cortana in Windows search. | | -DisableSuggestions | Disable tips, tricks, suggestions and ads in start, settings, notifications and File Explorer. | | -DisableDesktopSpotlight | Disable the 'Windows Spotlight' desktop background option. | | -DisableLockscreenTips | Disable tips & tricks on the lockscreen. | +| -DisableBing | Disable & remove Bing web search, Bing AI & Cortana in Windows search. | +| -DisableCopilot | Disable and remove Windows Copilot. (Windows 11 only) | +| -DisableRecall | Disable Windows Recall snapshots. (Windows 11 only) | | -RevertContextMenu | Restore the old Windows 10 style context menu. (Windows 11 only) | +| -DisableMouseAcceleration | Turn off Enhance Pointer Precision, also known as mouse acceleration. Requires reboot to apply. | | -ShowHiddenFolders | Show hidden files, folders and drives. | | -ShowKnownFileExt | Show file extensions for known file types. | | -HideDupliDrive | Hide duplicate removable drive entries from the File Explorer navigation pane, so only the entry under 'This PC' remains. | @@ -329,8 +333,6 @@ The quick and advanced usage methods support switch parameters. A table of all t | -HideChat | Hide the chat (meet now) icon from the taskbar. | | -DisableWidgets | Disable the widget service & hide the widget (news and interests) icon from the taskbar. | |
-DisableStartRecommended| Disable & hide the recommended section in the start menu. This will also change the start menu layout to `More pins`. | -| -DisableCopilot | Disable and remove Windows Copilot. (Windows 11 only) | -| -DisableRecall | Disable Windows Recall snapshots. (Windows 11 only) | | -HideHome | Hide the home section from the File Explorer navigation pane and add a toggle in the File Explorer folder options. (Windows 11 only) | | -HideGallery | Hide the gallery section from the File Explorer navigation pane and add a toggle in the File Explorer folder options. (Windows 11 only) | | -ExplorerToHome | Changes the page that File Explorer opens to `Home`. | diff --git a/Regfiles/Disable_Enhance_Pointer_Precision.reg b/Regfiles/Disable_Enhance_Pointer_Precision.reg new file mode 100644 index 0000000..25e1626 --- /dev/null +++ b/Regfiles/Disable_Enhance_Pointer_Precision.reg @@ -0,0 +1,6 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Control Panel\Mouse] +"MouseSpeed"="0" +"MouseThreshold1"="0" +"MouseThreshold2"="0" diff --git a/Regfiles/Sysprep/Disable_Enhance_Pointer_Precision.reg b/Regfiles/Sysprep/Disable_Enhance_Pointer_Precision.reg new file mode 100644 index 0000000..705cd3f --- /dev/null +++ b/Regfiles/Sysprep/Disable_Enhance_Pointer_Precision.reg @@ -0,0 +1,6 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Control Panel\Mouse] +"MouseSpeed"="0" +"MouseThreshold1"="0" +"MouseThreshold2"="0" diff --git a/Regfiles/Undo/Enable_Enhance_Pointer_Precision.reg b/Regfiles/Undo/Enable_Enhance_Pointer_Precision.reg new file mode 100644 index 0000000..4138547 --- /dev/null +++ b/Regfiles/Undo/Enable_Enhance_Pointer_Precision.reg @@ -0,0 +1,6 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Control Panel\Mouse] +"MouseSpeed"="1" +"MouseThreshold1"="6" +"MouseThreshold2"="10" diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index a191ebe..6bab61d 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -29,13 +29,12 @@ param ( [switch]$DisableStartRecommended, [switch]$DisableCopilot, [switch]$DisableRecall, - [switch]$DisableWidgets, - [switch]$HideWidgets, - [switch]$DisableChat, - [switch]$HideChat, + [switch]$DisableWidgets, [switch]$HideWidgets, + [switch]$DisableChat, [switch]$HideChat, [switch]$ClearStart, [switch]$ClearStartAllUsers, [switch]$RevertContextMenu, + [switch]$DisableMouseAcceleration, [switch]$HideHome, [switch]$HideGallery, [switch]$ExplorerToHome, @@ -51,7 +50,7 @@ param ( ) -# Show error if current powershell environment does not have LanguageMode set to FullLanguage +# Show error if current powershell environment is limited by security policies if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") { Write-Host "Error: Win11Debloat is unable to run on your system, powershell execution is restricted by security policies" -ForegroundColor Red Write-Output "" @@ -551,13 +550,17 @@ function RestartExplorer { Write-Output "> Restarting Windows Explorer process to apply all changes... (This may cause some flickering)" + if ($global:Params.ContainsKey("DisableMouseAcceleration")) { + Write-Host "Warning: The Enhance Pointer Precision setting has been changed, this setting will only take effect after a reboot" -ForegroundColor Yellow + } + # Only restart if the powershell process matches the OS architecture. # Restarting explorer from a 32bit Powershell window will fail on a 64bit OS if ([Environment]::Is64BitProcess -eq [Environment]::Is64BitOperatingSystem) { Stop-Process -processName: Explorer -Force } else { - Write-Warning "Unable to restart Windows Explorer process, please manually restart your PC to apply all changes." + Write-Warning "Unable to restart Windows Explorer process, please manually reboot your PC to apply all changes." } } @@ -710,6 +713,347 @@ function AwaitKeyToExit { } +function DisplayCustomModeOptions { + # Get current Windows build version to compare against features + $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild + + PrintHeader 'Custom Mode' + + # Show options for removing apps, only continue on valid input + Do { + Write-Host "Options:" -ForegroundColor Yellow + Write-Host " (n) Don't remove any apps" -ForegroundColor Yellow + Write-Host " (1) Only remove the default selection of bloatware apps from 'Appslist.txt'" -ForegroundColor Yellow + Write-Host " (2) Remove default selection of bloatware apps, aswell as mail & calendar apps, developer apps and gaming apps" -ForegroundColor Yellow + Write-Host " (3) Select which apps to remove and which to keep" -ForegroundColor Yellow + $RemoveAppsInput = Read-Host "Remove any pre-installed apps? (n/1/2/3)" + + # Show app selection form if user entered option 3 + if ($RemoveAppsInput -eq '3') { + $result = ShowAppSelectionForm + + if ($result -ne [System.Windows.Forms.DialogResult]::OK) { + # User cancelled or closed app selection, show error and change RemoveAppsInput so the menu will be shown again + Write-Output "" + Write-Host "Cancelled application selection, please try again" -ForegroundColor Red + + $RemoveAppsInput = 'c' + } + + Write-Output "" + } + } + while ($RemoveAppsInput -ne 'n' -and $RemoveAppsInput -ne '0' -and $RemoveAppsInput -ne '1' -and $RemoveAppsInput -ne '2' -and $RemoveAppsInput -ne '3') + + # Select correct option based on user input + switch ($RemoveAppsInput) { + '1' { + AddParameter 'RemoveApps' 'Remove default selection of bloatware apps' + } + '2' { + AddParameter 'RemoveApps' 'Remove default selection of bloatware apps' + AddParameter 'RemoveCommApps' 'Remove the Mail, Calendar, and People apps' + AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app' + AddParameter 'RemoveDevApps' 'Remove developer-related apps' + AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar' + AddParameter 'DisableDVR' 'Disable Xbox game/screen recording' + } + '3' { + Write-Output "You have selected $($global:SelectedApps.Count) apps for removal" + + AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:" + + Write-Output "" + + if ($( Read-Host -Prompt "Disable Xbox game/screen recording? Also stops gaming overlay popups (y/n)" ) -eq 'y') { + AddParameter 'DisableDVR' 'Disable Xbox game/screen recording' + } + } + } + + Write-Output "" + + if ($( Read-Host -Prompt "Disable telemetry, diagnostic data, activity history, app-launch tracking and targeted ads? (y/n)" ) -eq 'y') { + AddParameter 'DisableTelemetry' 'Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads' + } + + Write-Output "" + + if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer, desktop and lockscreen? (y/n)" ) -eq 'y') { + AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and File Explorer' + AddParameter 'DisableDesktopSpotlight' 'Disable the Windows Spotlight desktop background option.' + AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen' + } + + Write-Output "" + + if ($( Read-Host -Prompt "Disable & remove bing web search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') { + AddParameter 'DisableBing' 'Disable & remove bing web search, bing AI & cortana in Windows search' + } + + # Only show this option for Windows 11 users running build 22621 or later + if ($WinVersion -ge 22621){ + Write-Output "" + + if ($( Read-Host -Prompt "Disable & remove Windows Copilot? This applies to all users (y/n)" ) -eq 'y') { + AddParameter 'DisableCopilot' 'Disable and remove 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 + if ($WinVersion -ge 22000){ + Write-Output "" + + if ($( Read-Host -Prompt "Restore the old Windows 10 style context menu? (y/n)" ) -eq 'y') { + AddParameter 'RevertContextMenu' 'Restore the old Windows 10 style context menu' + } + } + + Write-Output "" + + if ($( Read-Host -Prompt "Turn off Enhance Pointer Precision, also known as mouse acceleration? (y/n)" ) -eq 'y') { + AddParameter 'DisableMouseAcceleration' 'Turn off Enhance Pointer Precision (mouse acceleration)' + } + + # Only show option for disabling context menu items for Windows 10 users or if the user opted to restore the Windows 10 context menu + if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") -or $global:Params.ContainsKey('RevertContextMenu')){ + Write-Output "" + + if ($( Read-Host -Prompt "Do you want to disable any context menu options? (y/n)" ) -eq 'y') { + Write-Output "" + + if ($( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n)" ) -eq 'y') { + AddParameter 'HideIncludeInLibrary' "Hide the 'Include in library' option in the context menu" + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n)" ) -eq 'y') { + AddParameter 'HideGiveAccessTo' "Hide the 'Give access to' option in the context menu" + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n)" ) -eq 'y') { + AddParameter 'HideShare' "Hide the 'Share' option in the context menu" + } + } + } + + # Only show this option for Windows 11 users running build 22621 or later + if ($WinVersion -ge 22621){ + Write-Output "" + + if ($( Read-Host -Prompt "Do you want to make any changes to the start menu? (y/n)" ) -eq 'y') { + Write-Output "" + + if ($global:Params.ContainsKey("Sysprep")) { + if ($( Read-Host -Prompt "Remove all pinned apps from the start menu for all existing and new users? (y/n)" ) -eq 'y') { + AddParameter 'ClearStartAllUsers' 'Remove all pinned apps from the start menu for existing and new users' + } + } + else { + Do { + Write-Host " Options:" -ForegroundColor Yellow + Write-Host " (n) Don't remove any pinned apps from the start menu" -ForegroundColor Yellow + Write-Host " (1) Remove all pinned apps from the start menu for this user only ($env:USERNAME)" -ForegroundColor Yellow + Write-Host " (2) Remove all pinned apps from the start menu for all existing and new users" -ForegroundColor Yellow + $ClearStartInput = Read-Host " Remove all pinned apps from the start menu? (n/1/2)" + } + while ($ClearStartInput -ne 'n' -and $ClearStartInput -ne '0' -and $ClearStartInput -ne '1' -and $ClearStartInput -ne '2') + + # Select correct option based on user input + switch ($ClearStartInput) { + '1' { + AddParameter 'ClearStart' "Remove all pinned apps from the start menu for this user only" + } + '2' { + AddParameter 'ClearStartAllUsers' "Remove all pinned apps from the start menu for all existing and new users" + } + } + } + + Write-Output "" + + if ($( Read-Host -Prompt " Disable & hide the recommended section in the start menu? This applies to all users (y/n)" ) -eq 'y') { + AddParameter 'DisableStartRecommended' 'Disable & hide the recommended section in the start menu.' + } + } + } + + Write-Output "" + + if ($( Read-Host -Prompt "Do you want to make any changes to the taskbar and related services? (y/n)" ) -eq 'y') { + # Only show these specific options for Windows 11 users running build 22000 or later + if ($WinVersion -ge 22000){ + Write-Output "" + + if ($( Read-Host -Prompt " Align taskbar buttons to the left side? (y/n)" ) -eq 'y') { + AddParameter 'TaskbarAlignLeft' 'Align taskbar icons to the left' + } + + # Show options for search icon on taskbar, only continue on valid input + Do { + Write-Output "" + Write-Host " Options:" -ForegroundColor Yellow + Write-Host " (n) No change" -ForegroundColor Yellow + Write-Host " (1) Hide search icon from the taskbar" -ForegroundColor Yellow + Write-Host " (2) Show search icon on the taskbar" -ForegroundColor Yellow + Write-Host " (3) Show search icon with label on the taskbar" -ForegroundColor Yellow + Write-Host " (4) Show search box on the taskbar" -ForegroundColor Yellow + $TbSearchInput = Read-Host " Hide or change the search icon on the taskbar? (n/1/2/3/4)" + } + while ($TbSearchInput -ne 'n' -and $TbSearchInput -ne '0' -and $TbSearchInput -ne '1' -and $TbSearchInput -ne '2' -and $TbSearchInput -ne '3' -and $TbSearchInput -ne '4') + + # Select correct taskbar search option based on user input + switch ($TbSearchInput) { + '1' { + AddParameter 'HideSearchTb' 'Hide search icon from the taskbar' + } + '2' { + AddParameter 'ShowSearchIconTb' 'Show search icon on the taskbar' + } + '3' { + AddParameter 'ShowSearchLabelTb' 'Show search icon with label on the taskbar' + } + '4' { + AddParameter 'ShowSearchBoxTb' 'Show search box on the taskbar' + } + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide the taskview button from the taskbar? (y/n)" ) -eq 'y') { + AddParameter 'HideTaskview' 'Hide the taskview button from the taskbar' + } + } + + Write-Output "" + + if ($( Read-Host -Prompt " Disable the widgets service and hide the icon from the taskbar? (y/n)" ) -eq 'y') { + AddParameter 'DisableWidgets' 'Disable the widget service & hide the widget (news and interests) icon from the taskbar' + } + + # Only show this options for Windows users running build 22621 or earlier + if ($WinVersion -le 22621){ + Write-Output "" + + if ($( Read-Host -Prompt " Hide the chat (meet now) icon from the taskbar? (y/n)" ) -eq 'y') { + AddParameter 'HideChat' 'Hide the chat (meet now) icon from the taskbar' + } + } + } + + Write-Output "" + + if ($( Read-Host -Prompt "Do you want to make any changes to File Explorer? (y/n)" ) -eq 'y') { + # Show options for changing the File Explorer default location + Do { + Write-Output "" + Write-Host " Options:" -ForegroundColor Yellow + Write-Host " (n) No change" -ForegroundColor Yellow + Write-Host " (1) Open File Explorer to 'Home'" -ForegroundColor Yellow + Write-Host " (2) Open File Explorer to 'This PC'" -ForegroundColor Yellow + Write-Host " (3) Open File Explorer to 'Downloads'" -ForegroundColor Yellow + Write-Host " (4) Open File Explorer to 'OneDrive'" -ForegroundColor Yellow + $ExplSearchInput = Read-Host " Change the default location that File Explorer opens to? (n/1/2/3/4)" + } + while ($ExplSearchInput -ne 'n' -and $ExplSearchInput -ne '0' -and $ExplSearchInput -ne '1' -and $ExplSearchInput -ne '2' -and $ExplSearchInput -ne '3' -and $ExplSearchInput -ne '4') + + # Select correct taskbar search option based on user input + switch ($ExplSearchInput) { + '1' { + AddParameter 'ExplorerToHome' "Change the default location that File Explorer opens to 'Home'" + } + '2' { + AddParameter 'ExplorerToThisPC' "Change the default location that File Explorer opens to 'This PC'" + } + '3' { + AddParameter 'ExplorerToDownloads' "Change the default location that File Explorer opens to 'Downloads'" + } + '4' { + AddParameter 'ExplorerToOneDrive' "Change the default location that File Explorer opens to 'OneDrive'" + } + } + + Write-Output "" + + if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') { + AddParameter 'ShowHiddenFolders' 'Show hidden files, folders and drives' + } + + Write-Output "" + + if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') { + AddParameter 'ShowKnownFileExt' 'Show file extensions for known file types' + } + + # Only show this option for Windows 11 users running build 22000 or later + if ($WinVersion -ge 22000){ + Write-Output "" + + if ($( Read-Host -Prompt " Hide the Home section from the File Explorer sidepanel? (y/n)" ) -eq 'y') { + AddParameter 'HideHome' 'Hide the Home section from the File Explorer sidepanel' + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide the Gallery section from the File Explorer sidepanel? (y/n)" ) -eq 'y') { + AddParameter 'HideGallery' 'Hide the Gallery section from the File Explorer sidepanel' + } + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the File Explorer sidepanel so they only show under This PC? (y/n)" ) -eq 'y') { + AddParameter 'HideDupliDrive' 'Hide duplicate removable drive entries from the File Explorer sidepanel' + } + + # Only show option for disabling these specific folders for Windows 10 users + if (get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'"){ + Write-Output "" + + if ($( Read-Host -Prompt "Do you want to hide any folders from the File Explorer sidepanel? (y/n)" ) -eq 'y') { + Write-Output "" + + if ($( Read-Host -Prompt " Hide the OneDrive folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { + AddParameter 'HideOnedrive' 'Hide the OneDrive folder in the File Explorer sidepanel' + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide the 3D objects folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { + AddParameter 'Hide3dObjects' "Hide the 3D objects folder under 'This pc' in File Explorer" + } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide the music folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { + AddParameter 'HideMusic' "Hide the music folder under 'This pc' in File Explorer" + } + } + } + } + + # Suppress prompt if Silent parameter was passed + if (-not $Silent) { + Write-Output "" + Write-Output "" + Write-Output "" + Write-Output "Press enter to confirm your choices and execute the script or press CTRL+C to quit..." + Read-Host | Out-Null + } + + PrintHeader 'Custom Mode' +} + + ################################################################################################################## # # @@ -888,337 +1232,7 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or $RunS # Custom mode, show & add options based on user input '2' { - # Get current Windows build version to compare against features - $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild - - PrintHeader 'Custom Mode' - - # Show options for removing apps, only continue on valid input - Do { - Write-Host "Options:" -ForegroundColor Yellow - Write-Host " (n) Don't remove any apps" -ForegroundColor Yellow - Write-Host " (1) Only remove the default selection of bloatware apps from 'Appslist.txt'" -ForegroundColor Yellow - Write-Host " (2) Remove default selection of bloatware apps, aswell as mail & calendar apps, developer apps and gaming apps" -ForegroundColor Yellow - Write-Host " (3) Select which apps to remove and which to keep" -ForegroundColor Yellow - $RemoveAppsInput = Read-Host "Remove any pre-installed apps? (n/1/2/3)" - - # Show app selection form if user entered option 3 - if ($RemoveAppsInput -eq '3') { - $result = ShowAppSelectionForm - - if ($result -ne [System.Windows.Forms.DialogResult]::OK) { - # User cancelled or closed app selection, show error and change RemoveAppsInput so the menu will be shown again - Write-Output "" - Write-Host "Cancelled application selection, please try again" -ForegroundColor Red - - $RemoveAppsInput = 'c' - } - - Write-Output "" - } - } - while ($RemoveAppsInput -ne 'n' -and $RemoveAppsInput -ne '0' -and $RemoveAppsInput -ne '1' -and $RemoveAppsInput -ne '2' -and $RemoveAppsInput -ne '3') - - # Select correct option based on user input - switch ($RemoveAppsInput) { - '1' { - AddParameter 'RemoveApps' 'Remove default selection of bloatware apps' - } - '2' { - AddParameter 'RemoveApps' 'Remove default selection of bloatware apps' - AddParameter 'RemoveCommApps' 'Remove the Mail, Calendar, and People apps' - AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app' - AddParameter 'RemoveDevApps' 'Remove developer-related apps' - AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar' - AddParameter 'DisableDVR' 'Disable Xbox game/screen recording' - } - '3' { - Write-Output "You have selected $($global:SelectedApps.Count) apps for removal" - - AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:" - - Write-Output "" - - if ($( Read-Host -Prompt "Disable Xbox game/screen recording? Also stops gaming overlay popups (y/n)" ) -eq 'y') { - AddParameter 'DisableDVR' 'Disable Xbox game/screen recording' - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable telemetry, diagnostic data, activity history, app-launch tracking and targeted ads? (y/n)" ) -eq 'y') { - AddParameter 'DisableTelemetry' 'Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads' - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer, desktop and lockscreen? (y/n)" ) -eq 'y') { - AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and File Explorer' - AddParameter 'DisableDesktopSpotlight' 'Disable the Windows Spotlight desktop background option.' - AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen' - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable & remove bing web search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') { - AddParameter 'DisableBing' 'Disable & remove bing web search, bing AI & cortana in Windows search' - } - - # Only show this option for Windows 11 users running build 22621 or later - if ($WinVersion -ge 22621){ - Write-Output "" - - if ($( Read-Host -Prompt "Disable & remove Windows Copilot? This applies to all users (y/n)" ) -eq 'y') { - AddParameter 'DisableCopilot' 'Disable and remove 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 - if ($WinVersion -ge 22000){ - Write-Output "" - - if ($( Read-Host -Prompt "Restore the old Windows 10 style context menu? (y/n)" ) -eq 'y') { - AddParameter 'RevertContextMenu' 'Restore the old Windows 10 style context menu' - } - } - - # Only show this option for Windows 11 users running build 22621 or later - if ($WinVersion -ge 22621){ - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to make any changes to the start menu? (y/n)" ) -eq 'y') { - Write-Output "" - - if ($global:Params.ContainsKey("Sysprep")) { - if ($( Read-Host -Prompt "Remove all pinned apps from the start menu for all existing and new users? (y/n)" ) -eq 'y') { - AddParameter 'ClearStartAllUsers' 'Remove all pinned apps from the start menu for existing and new users' - } - } - else { - Do { - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) Don't remove any pinned apps from the start menu" -ForegroundColor Yellow - Write-Host " (1) Remove all pinned apps from the start menu for this user only ($env:USERNAME)" -ForegroundColor Yellow - Write-Host " (2) Remove all pinned apps from the start menu for all existing and new users" -ForegroundColor Yellow - $ClearStartInput = Read-Host " Remove all pinned apps from the start menu? (n/1/2)" - } - while ($ClearStartInput -ne 'n' -and $ClearStartInput -ne '0' -and $ClearStartInput -ne '1' -and $ClearStartInput -ne '2') - - # Select correct option based on user input - switch ($ClearStartInput) { - '1' { - AddParameter 'ClearStart' "Remove all pinned apps from the start menu for this user only" - } - '2' { - AddParameter 'ClearStartAllUsers' "Remove all pinned apps from the start menu for all existing and new users" - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Disable & hide the recommended section in the start menu? This applies to all users (y/n)" ) -eq 'y') { - AddParameter 'DisableStartRecommended' 'Disable & hide the recommended section in the start menu.' - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to make any changes to the taskbar and related services? (y/n)" ) -eq 'y') { - # Only show these specific options for Windows 11 users running build 22000 or later - if ($WinVersion -ge 22000){ - Write-Output "" - - if ($( Read-Host -Prompt " Align taskbar buttons to the left side? (y/n)" ) -eq 'y') { - AddParameter 'TaskbarAlignLeft' 'Align taskbar icons to the left' - } - - # Show options for search icon on taskbar, only continue on valid input - Do { - Write-Output "" - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) No change" -ForegroundColor Yellow - Write-Host " (1) Hide search icon from the taskbar" -ForegroundColor Yellow - Write-Host " (2) Show search icon on the taskbar" -ForegroundColor Yellow - Write-Host " (3) Show search icon with label on the taskbar" -ForegroundColor Yellow - Write-Host " (4) Show search box on the taskbar" -ForegroundColor Yellow - $TbSearchInput = Read-Host " Hide or change the search icon on the taskbar? (n/1/2/3/4)" - } - while ($TbSearchInput -ne 'n' -and $TbSearchInput -ne '0' -and $TbSearchInput -ne '1' -and $TbSearchInput -ne '2' -and $TbSearchInput -ne '3' -and $TbSearchInput -ne '4') - - # Select correct taskbar search option based on user input - switch ($TbSearchInput) { - '1' { - AddParameter 'HideSearchTb' 'Hide search icon from the taskbar' - } - '2' { - AddParameter 'ShowSearchIconTb' 'Show search icon on the taskbar' - } - '3' { - AddParameter 'ShowSearchLabelTb' 'Show search icon with label on the taskbar' - } - '4' { - AddParameter 'ShowSearchBoxTb' 'Show search box on the taskbar' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the taskview button from the taskbar? (y/n)" ) -eq 'y') { - AddParameter 'HideTaskview' 'Hide the taskview button from the taskbar' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Disable the widgets service and hide the icon from the taskbar? (y/n)" ) -eq 'y') { - AddParameter 'DisableWidgets' 'Disable the widget service & hide the widget (news and interests) icon from the taskbar' - } - - # Only show this options for Windows users running build 22621 or earlier - if ($WinVersion -le 22621){ - Write-Output "" - - if ($( Read-Host -Prompt " Hide the chat (meet now) icon from the taskbar? (y/n)" ) -eq 'y') { - AddParameter 'HideChat' 'Hide the chat (meet now) icon from the taskbar' - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to make any changes to File Explorer? (y/n)" ) -eq 'y') { - # Show options for changing the File Explorer default location - Do { - Write-Output "" - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) No change" -ForegroundColor Yellow - Write-Host " (1) Open File Explorer to 'Home'" -ForegroundColor Yellow - Write-Host " (2) Open File Explorer to 'This PC'" -ForegroundColor Yellow - Write-Host " (3) Open File Explorer to 'Downloads'" -ForegroundColor Yellow - Write-Host " (4) Open File Explorer to 'OneDrive'" -ForegroundColor Yellow - $ExplSearchInput = Read-Host " Change the default location that File Explorer opens to? (n/1/2/3/4)" - } - while ($ExplSearchInput -ne 'n' -and $ExplSearchInput -ne '0' -and $ExplSearchInput -ne '1' -and $ExplSearchInput -ne '2' -and $ExplSearchInput -ne '3' -and $ExplSearchInput -ne '4') - - # Select correct taskbar search option based on user input - switch ($ExplSearchInput) { - '1' { - AddParameter 'ExplorerToHome' "Change the default location that File Explorer opens to 'Home'" - } - '2' { - AddParameter 'ExplorerToThisPC' "Change the default location that File Explorer opens to 'This PC'" - } - '3' { - AddParameter 'ExplorerToDownloads' "Change the default location that File Explorer opens to 'Downloads'" - } - '4' { - AddParameter 'ExplorerToOneDrive' "Change the default location that File Explorer opens to 'OneDrive'" - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') { - AddParameter 'ShowHiddenFolders' 'Show hidden files, folders and drives' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') { - AddParameter 'ShowKnownFileExt' 'Show file extensions for known file types' - } - - # Only show this option for Windows 11 users running build 22000 or later - if ($WinVersion -ge 22000){ - Write-Output "" - - if ($( Read-Host -Prompt " Hide the Home section from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideHome' 'Hide the Home section from the File Explorer sidepanel' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the Gallery section from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideGallery' 'Hide the Gallery section from the File Explorer sidepanel' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the File Explorer sidepanel so they only show under This PC? (y/n)" ) -eq 'y') { - AddParameter 'HideDupliDrive' 'Hide duplicate removable drive entries from the File Explorer sidepanel' - } - - # Only show option for disabling these specific folders for Windows 10 users - if (get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'"){ - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to hide any folders from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - Write-Output "" - - if ($( Read-Host -Prompt " Hide the OneDrive folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideOnedrive' 'Hide the OneDrive folder in the File Explorer sidepanel' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 3D objects folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'Hide3dObjects' "Hide the 3D objects folder under 'This pc' in File Explorer" - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the music folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideMusic' "Hide the music folder under 'This pc' in File Explorer" - } - } - } - } - - # Only show option for disabling context menu items for Windows 10 users or if the user opted to restore the Windows 10 context menu - if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") -or $global:Params.ContainsKey('RevertContextMenu')){ - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to disable any context menu options? (y/n)" ) -eq 'y') { - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n)" ) -eq 'y') { - AddParameter 'HideIncludeInLibrary' "Hide the 'Include in library' option in the context menu" - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n)" ) -eq 'y') { - AddParameter 'HideGiveAccessTo' "Hide the 'Give access to' option in the context menu" - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n)" ) -eq 'y') { - AddParameter 'HideShare' "Hide the 'Share' option in the context menu" - } - } - } - - # Suppress prompt if Silent parameter was passed - if (-not $Silent) { - Write-Output "" - Write-Output "" - Write-Output "" - Write-Output "Press enter to confirm your choices and execute the script or press CTRL+C to quit..." - Read-Host | Out-Null - } - - PrintHeader 'Custom Mode' + DisplayCustomModeOptions } # App removal, remove apps based on user selection @@ -1357,26 +1371,12 @@ else { RegImport "> Disabling Xbox game/screen recording..." "Disable_DVR.reg" continue } - 'ClearStart' { - Write-Output "> Removing all pinned apps from the start menu for user $env:USERNAME..." - ReplaceStartMenu - Write-Output "" - continue - } - 'ClearStartAllUsers' { - ReplaceStartMenuForAllUsers - continue - } 'DisableTelemetry' { RegImport "> Disabling telemetry, diagnostic data, activity history, app-launch tracking and targeted ads..." "Disable_Telemetry.reg" continue } - {$_ -in "DisableBingSearches", "DisableBing"} { - RegImport "> Disabling bing web search, bing AI & cortana in Windows search..." "Disable_Bing_Cortana_In_Search.reg" - - # Also remove the app package for bing search - $appsList = 'Microsoft.BingSearch' - RemoveApps $appsList + {$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} { + RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." "Disable_Windows_Suggestions.reg" continue } 'DisableDesktopSpotlight' { @@ -1387,14 +1387,48 @@ else { RegImport "> Disabling tips & tricks on the lockscreen..." "Disable_Lockscreen_Tips.reg" continue } - {$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} { - RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." "Disable_Windows_Suggestions.reg" + {$_ -in "DisableBingSearches", "DisableBing"} { + RegImport "> Disabling bing web search, bing AI & cortana in Windows search..." "Disable_Bing_Cortana_In_Search.reg" + + # Also remove the app package for bing search + $appsList = 'Microsoft.BingSearch' + RemoveApps $appsList + continue + } + 'DisableCopilot' { + RegImport "> Disabling & removing Windows Copilot..." "Disable_Copilot.reg" + + # Also remove the app package for bing search + $appsList = 'Microsoft.Copilot' + RemoveApps $appsList + continue + } + 'DisableRecall' { + RegImport "> Disabling Windows Recall snapshots..." "Disable_AI_Recall.reg" continue } 'RevertContextMenu' { RegImport "> Restoring the old Windows 10 style context menu..." "Disable_Show_More_Options_Context_Menu.reg" continue } + 'DisableMouseAcceleration' { + RegImport "> Turning off Enhanced Pointer Precision..." "Disable_Enhance_Pointer_Precision.reg" + continue + } + 'ClearStart' { + Write-Output "> Removing all pinned apps from the start menu for user $env:USERNAME..." + ReplaceStartMenu + Write-Output "" + continue + } + 'ClearStartAllUsers' { + ReplaceStartMenuForAllUsers + continue + } + 'DisableStartRecommended' { + RegImport "> Disabling and hiding the start menu recommended section..." "Disable_Start_Recommended.reg" + continue + } 'TaskbarAlignLeft' { RegImport "> Aligning taskbar buttons to the left..." "Align_Taskbar_Left.reg" @@ -1420,22 +1454,6 @@ else { RegImport "> Hiding the taskview button from the taskbar..." "Hide_Taskview_Taskbar.reg" continue } - 'DisableStartRecommended' { - RegImport "> Disabling and hiding the start menu recommended section..." "Disable_Start_Recommended.reg" - continue - } - 'DisableCopilot' { - RegImport "> Disabling & removing Windows Copilot..." "Disable_Copilot.reg" - - # Also remove the app package for bing search - $appsList = 'Microsoft.Copilot' - RemoveApps $appsList - continue - } - 'DisableRecall' { - RegImport "> Disabling Windows Recall snapshots..." "Disable_AI_Recall.reg" - continue - } {$_ -in "HideWidgets", "DisableWidgets"} { RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." "Disable_Widgets_Taskbar.reg" continue @@ -1444,22 +1462,6 @@ else { RegImport "> Hiding the chat icon from the taskbar..." "Disable_Chat_Taskbar.reg" continue } - 'ShowHiddenFolders' { - RegImport "> Unhiding hidden files, folders and drives..." "Show_Hidden_Folders.reg" - continue - } - 'ShowKnownFileExt' { - RegImport "> Enabling file extensions for known file types..." "Show_Extensions_For_Known_File_Types.reg" - continue - } - 'HideHome' { - RegImport "> Hiding the home section from the File Explorer navigation pane..." "Hide_Home_from_Explorer.reg" - continue - } - 'HideGallery' { - RegImport "> Hiding the gallery section from the File Explorer navigation pane..." "Hide_Gallery_from_Explorer.reg" - continue - } 'ExplorerToHome' { RegImport "> Changing the default location that File Explorer opens to `Home`..." "Launch_File_Explorer_To_Home.reg" continue @@ -1476,6 +1478,22 @@ else { RegImport "> Changing the default location that File Explorer opens to `OneDrive`..." "Launch_File_Explorer_To_OneDrive.reg" continue } + 'ShowHiddenFolders' { + RegImport "> Unhiding hidden files, folders and drives..." "Show_Hidden_Folders.reg" + continue + } + 'ShowKnownFileExt' { + RegImport "> Enabling file extensions for known file types..." "Show_Extensions_For_Known_File_Types.reg" + continue + } + 'HideHome' { + RegImport "> Hiding the home section from the File Explorer navigation pane..." "Hide_Home_from_Explorer.reg" + continue + } + 'HideGallery' { + RegImport "> Hiding the gallery section from the File Explorer navigation pane..." "Hide_Gallery_from_Explorer.reg" + continue + } 'HideDupliDrive' { RegImport "> Hiding duplicate removable drive entries from the File Explorer navigation pane..." "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg" continue