mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Compare commits
10 Commits
2025.08.16
...
2025.09.08
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
260895618d | ||
|
|
a662273414 | ||
|
|
6c4b401a21 | ||
|
|
75f71972b3 | ||
|
|
c3de7803ae | ||
|
|
8ce501511f | ||
|
|
a65548b9b7 | ||
|
|
98b9348b70 | ||
|
|
b100cf15f2 | ||
|
|
b6dc5c0147 |
@@ -7,9 +7,10 @@ Win11Debloat will make the following changes:
|
||||
- Disable & remove Bing web search, Bing AI and Cortana from Windows search.
|
||||
- Disable & remove Microsoft Copilot. (W11 only)
|
||||
- Disable Fast Start-up to ensure a full shutdown.
|
||||
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only)
|
||||
- Show file extensions for known file types.
|
||||
- Hide the 3D objects folder in Windows Explorer. (W10 only)
|
||||
- Disable the widget service & hide the icon from the taskbar.
|
||||
- Disable widgets on the taskbar & lockscreen.
|
||||
- Hide the Chat (meet now) icon from the taskbar.
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Taskbar
|
||||
- Align taskbar icons to the left. (W11 only)
|
||||
- Hide or change the search icon/box on the taskbar. (W11 only)
|
||||
- Hide the taskview button from the taskbar. (W11 only)
|
||||
- Disable the widgets service & hide icon from the taskbar.
|
||||
- Disable widgets on the taskbar & lockscreen.
|
||||
- Hide the chat (meet now) icon from the taskbar.
|
||||
- Enable the 'End Task' option in the taskbar right click menu. (W11 only)
|
||||
- Enable the 'Last Active Click' behavior in the taskbar app area.
|
||||
@@ -54,6 +54,7 @@ Start
|
||||
Other
|
||||
- Disable Xbox game/screen recording, this also stops gaming overlay popups.
|
||||
- Disable Fast Start-up to ensure a full shutdown.
|
||||
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only)
|
||||
- Option to apply changes to a different user, instead of the currently logged in user.
|
||||
- Sysprep mode to apply changes to the Windows Default user profile.
|
||||
|
||||
|
||||
3
Get.ps1
3
Get.ps1
@@ -19,6 +19,7 @@ param (
|
||||
[switch]$DisableDVR,
|
||||
[switch]$DisableTelemetry,
|
||||
[switch]$DisableFastStartup,
|
||||
[switch]$DisableModernStandbyNetworking,
|
||||
[switch]$DisableBingSearches, [switch]$DisableBing,
|
||||
[switch]$DisableDesktopSpotlight,
|
||||
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
||||
@@ -84,7 +85,7 @@ Write-Output "------------------------------------------------------------------
|
||||
Write-Output "> Downloading Win11Debloat..."
|
||||
|
||||
# Download latest version of Win11Debloat from github as zip archive
|
||||
Invoke-RestMethod https://api.github.com/repos/Raphire/Win11Debloat/zipball/2025.08.16 -OutFile "$env:TEMP/win11debloat.zip"
|
||||
Invoke-RestMethod https://api.github.com/repos/Raphire/Win11Debloat/zipball/2025.09.08 -OutFile "$env:TEMP/win11debloat.zip"
|
||||
|
||||
# Remove old script folder if it exists, except for CustomAppsList and SavedSettings files
|
||||
if (Test-Path "$env:TEMP/Win11Debloat") {
|
||||
|
||||
10
README.md
10
README.md
@@ -47,7 +47,7 @@ Download & run the script automatically via PowerShell.
|
||||
3. Wait for the script to automatically download Win11Debloat.
|
||||
4. Carefully read through and follow the on-screen instructions.
|
||||
|
||||
This method supports parameters to customize the behaviour of the script. Please click [here](https://github.com/Raphire/Win11Debloat/wiki/How-To-Use#parameters) for more information.
|
||||
This method supports command-line parameters to customize the behaviour of the script. Please click [here](https://github.com/Raphire/Win11Debloat/wiki/How-To-Use#parameters) for more information.
|
||||
|
||||
### Traditional method
|
||||
|
||||
@@ -83,7 +83,7 @@ This method supports parameters to customize the behaviour of the script. Please
|
||||
|
||||
6. Carefully read through and follow the on-screen instructions.
|
||||
|
||||
This method supports parameters to customize the behaviour of the script. Please click [here](https://github.com/Raphire/Win11Debloat/wiki/How-To-Use#parameters) for more information.
|
||||
This method supports command-line parameters to customize the behaviour of the script. Please click [here](https://github.com/Raphire/Win11Debloat/wiki/How-To-Use#parameters) for more information.
|
||||
</details>
|
||||
|
||||
## Features
|
||||
@@ -137,7 +137,7 @@ Below is an overview of the key features and functionality offered by Win11Deblo
|
||||
- Align taskbar icons to the left. (W11 only)
|
||||
- Hide or change the search icon/box on the taskbar. (W11 only)
|
||||
- Hide the taskview button from the taskbar. (W11 only)
|
||||
- Disable the widgets service & hide icon from the taskbar.
|
||||
- Disable widgets on the taskbar & lockscreen.
|
||||
- Hide the chat (meet now) icon from the taskbar.
|
||||
- Enable the 'End Task' option in the taskbar right click menu. (W11 only)
|
||||
- Enable the 'Last Active Click' behavior in the taskbar app area. This allows you to repeatedly click on an application's icon in the taskbar to switch focus between the open windows of that application.
|
||||
@@ -151,6 +151,7 @@ Below is an overview of the key features and functionality offered by Win11Deblo
|
||||
|
||||
- Disable Xbox game/screen recording, this also stops gaming overlay popups.
|
||||
- Disable Fast Start-up to ensure a full shutdown.
|
||||
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only)
|
||||
- Option to [apply changes to a different user](https://github.com/Raphire/Win11Debloat/wiki/Advanced-Features#running-as-another-user), instead of the currently logged in user.
|
||||
- [Sysprep mode](https://github.com/Raphire/Win11Debloat/wiki/Advanced-Features#sysprep-mode) to apply changes to the Windows Default user profile. Afterwards, all new users will have the changes automatically applied to them.
|
||||
|
||||
@@ -170,9 +171,10 @@ Win11Debloat offers a default mode that allows you to quickly and easily apply t
|
||||
- Disable & remove Bing web search, Bing AI and Cortana from Windows search.
|
||||
- Disable & remove Microsoft Copilot. (W11 only)
|
||||
- Disable Fast Start-up to ensure a full shutdown.
|
||||
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only)
|
||||
- Show file extensions for known file types.
|
||||
- Hide the 3D objects folder under 'This pc' from File Explorer. (W10 only)
|
||||
- Disable the widget service & hide the icon from the taskbar.
|
||||
- Disable widgets on the taskbar & lockscreen.
|
||||
- Hide the Chat (meet now) icon from the taskbar.
|
||||
|
||||
#### Apps that ARE removed as part of the default mode
|
||||
|
||||
5
Regfiles/Disable_Modern_Standby_Networking.reg
Normal file
5
Regfiles/Disable_Modern_Standby_Networking.reg
Normal file
@@ -0,0 +1,5 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9]
|
||||
"ACSettingIndex"=dword:00000000
|
||||
"DCSettingIndex"=dword:00000000
|
||||
Binary file not shown.
5
Regfiles/Sysprep/Disable_Modern_Standby_Networking.reg
Normal file
5
Regfiles/Sysprep/Disable_Modern_Standby_Networking.reg
Normal file
@@ -0,0 +1,5 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9]
|
||||
"ACSettingIndex"=dword:00000000
|
||||
"DCSettingIndex"=dword:00000000
|
||||
Binary file not shown.
@@ -3,3 +3,7 @@ Windows Registry Editor Version 5.00
|
||||
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize]
|
||||
"AppsUseLightTheme"=dword:00000000
|
||||
"SystemUsesLightTheme"=dword:00000000
|
||||
|
||||
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
|
||||
"AppsUseLightTheme"="reg add HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize /v AppsUseLightTheme /t REG_DWORD /d 0 /f"
|
||||
"SystemUsesLightTheme"="reg add HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize /v SystemUsesLightTheme /t REG_DWORD /d 0 /f"
|
||||
|
||||
5
Regfiles/Undo/Enable_Modern_Standby_Networking.reg
Normal file
5
Regfiles/Undo/Enable_Modern_Standby_Networking.reg
Normal file
@@ -0,0 +1,5 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9]
|
||||
"ACSettingIndex"=dword:00000001
|
||||
"DCSettingIndex"=dword:00000001
|
||||
Binary file not shown.
Binary file not shown.
116
Win11Debloat.ps1
116
Win11Debloat.ps1
@@ -21,6 +21,7 @@ param (
|
||||
[switch]$DisableDVR,
|
||||
[switch]$DisableTelemetry,
|
||||
[switch]$DisableFastStartup,
|
||||
[switch]$DisableModernStandbyNetworking,
|
||||
[switch]$DisableBingSearches, [switch]$DisableBing,
|
||||
[switch]$DisableDesktopSpotlight,
|
||||
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
||||
@@ -541,6 +542,62 @@ function Strip-Progress {
|
||||
}
|
||||
|
||||
|
||||
# Check if this machine supports S0 Modern Standby power state. Returns true if S0 Modern Standby is supported, false otherwise.
|
||||
function CheckModernStandbySupport {
|
||||
$count = 0
|
||||
|
||||
try {
|
||||
switch -Regex (powercfg /a) {
|
||||
':' {
|
||||
$count += 1
|
||||
}
|
||||
|
||||
'(.*S0.{1,}\))' {
|
||||
if ($count -eq 1) {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "Error: Unable to check for S0 Modern Standby support, powercfg command failed" -ForegroundColor Red
|
||||
Write-Host ""
|
||||
Write-Host "Press any key to continue..."
|
||||
$null = [System.Console]::ReadKey()
|
||||
return $true
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
|
||||
# Returns the directory path of the specified user, exits script if user path can't be found
|
||||
function GetUserDirectory {
|
||||
param (
|
||||
$userName,
|
||||
$fileName = "",
|
||||
$exitIfPathNotFound = $true
|
||||
)
|
||||
|
||||
$userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName"
|
||||
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
|
||||
|
||||
if ((Test-Path $userPath) -or ($userDirectoryExists -and (-not $exitIfPathNotFound))) {
|
||||
return $userPath
|
||||
}
|
||||
|
||||
$userDirectoryExists = Test-Path $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName"
|
||||
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName\$fileName"
|
||||
|
||||
if ((Test-Path $userPath) -or ($userDirectoryExists -and (-not $exitIfPathNotFound))) {
|
||||
return $userPath
|
||||
}
|
||||
|
||||
Write-Host "Error: Unable to find user directory path for user $userName" -ForegroundColor Red
|
||||
AwaitKeyToExit
|
||||
}
|
||||
|
||||
|
||||
# Import & execute regfile
|
||||
function RegImport {
|
||||
param (
|
||||
@@ -551,14 +608,14 @@ function RegImport {
|
||||
Write-Output $message
|
||||
|
||||
if ($script:Params.ContainsKey("Sysprep")) {
|
||||
$defaultUserPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), '\Default\NTUSER.DAT'
|
||||
$defaultUserPath = GetUserDirectory -userName "Default" -fileName "NTUSER.DAT"
|
||||
|
||||
reg load "HKU\Default" $defaultUserPath | Out-Null
|
||||
reg import "$PSScriptRoot\Regfiles\Sysprep\$path"
|
||||
reg unload "HKU\Default" | Out-Null
|
||||
}
|
||||
elseif ($script:Params.ContainsKey("User")) {
|
||||
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$($script:Params.Item("User"))\NTUSER.DAT"
|
||||
$userPath = GetUserDirectory -userName $script:Params.Item("User") -fileName "NTUSER.DAT"
|
||||
|
||||
reg load "HKU\Default" $userPath | Out-Null
|
||||
reg import "$PSScriptRoot\Regfiles\Sysprep\$path"
|
||||
@@ -621,7 +678,7 @@ function ReplaceStartMenuForAllUsers {
|
||||
}
|
||||
|
||||
# Get path to start menu file for all users
|
||||
$userPathString = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\*\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
||||
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
||||
$usersStartMenuPaths = get-childitem -path $userPathString
|
||||
|
||||
# Go through all users and replace the start menu file
|
||||
@@ -630,7 +687,7 @@ function ReplaceStartMenuForAllUsers {
|
||||
}
|
||||
|
||||
# Also replace the start menu file for the default user profile
|
||||
$defaultStartMenuPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), '\Default\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState'
|
||||
$defaultStartMenuPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" -exitIfPathNotFound $false
|
||||
|
||||
# Create folder if it doesn't exist
|
||||
if (-not (Test-Path $defaultStartMenuPath)) {
|
||||
@@ -655,7 +712,7 @@ function ReplaceStartMenu {
|
||||
|
||||
# Change path to correct user if a user was specified
|
||||
if ($script:Params.ContainsKey("User")) {
|
||||
$startMenuBinFile = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$(GetUserName)\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||
$startMenuBinFile = GetUserDirectory -userName "$(GetUserName)" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||
}
|
||||
|
||||
# Check if template bin file exists, return early if it doesn't
|
||||
@@ -669,9 +726,11 @@ function ReplaceStartMenu {
|
||||
return
|
||||
}
|
||||
|
||||
$userName = [regex]::Match($startMenuBinFile, '(?:Users\\)([^\\]+)(?:\\AppData)').Groups[1].Value
|
||||
|
||||
# Check if bin file exists, return early if it doesn't
|
||||
if (-not (Test-Path $startMenuBinFile)) {
|
||||
Write-Host "Error: Unable to replace start menu for user $(GetUserName), original start2.bin file not found" -ForegroundColor Red
|
||||
Write-Host "Error: Unable to replace start menu for user $userName, original start2.bin file not found" -ForegroundColor Red
|
||||
return
|
||||
}
|
||||
|
||||
@@ -683,7 +742,7 @@ function ReplaceStartMenu {
|
||||
# Copy template file
|
||||
Copy-Item -Path $startMenuTemplate -Destination $startMenuBinFile -Force
|
||||
|
||||
Write-Output "Replaced start menu for user $(GetUserName)"
|
||||
Write-Output "Replaced start menu for user $userName"
|
||||
}
|
||||
|
||||
|
||||
@@ -1006,6 +1065,15 @@ function DisplayCustomModeOptions {
|
||||
AddParameter 'DisableFastStartup' 'Disable Fast Start-up'
|
||||
}
|
||||
|
||||
# Only show this option for Windows 11 users running build 22000 or later, and if the machine has at least one battery
|
||||
if (($WinVersion -ge 22000) -and $script:ModernStandbySupported) {
|
||||
Write-Output ""
|
||||
|
||||
if ($( Read-Host -Prompt "Disable network connectivity during Modern Standby? This applies to all users (y/n)" ) -eq 'y') {
|
||||
AddParameter 'DisableModernStandbyNetworking' 'Disable network connectivity during Modern Standby'
|
||||
}
|
||||
}
|
||||
|
||||
# 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 $script:Params.ContainsKey('RevertContextMenu')) {
|
||||
Write-Output ""
|
||||
@@ -1127,8 +1195,8 @@ function DisplayCustomModeOptions {
|
||||
|
||||
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'
|
||||
if ($( Read-Host -Prompt " Disable the widgets service to remove widgets on the taskbar & lockscreen? (y/n)" ) -eq 'y') {
|
||||
AddParameter 'DisableWidgets' 'Disable widgets on the taskbar & lockscreen'
|
||||
}
|
||||
|
||||
# Only show this options for Windows users running build 22621 or earlier
|
||||
@@ -1287,6 +1355,9 @@ else {
|
||||
# Get current Windows build version to compare against features
|
||||
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
||||
|
||||
# Check if the machine supports Modern Standby, this is used to determine if the DisableModernStandbyNetworking option can be used
|
||||
$script:ModernStandbySupported = CheckModernStandbySupport
|
||||
|
||||
$script:Params = $PSBoundParameters
|
||||
$script:FirstSelection = $true
|
||||
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep', 'Debug', 'User', 'CreateRestorePoint', 'LogPath'
|
||||
@@ -1313,15 +1384,9 @@ else {
|
||||
$ProgressPreference = 'Continue'
|
||||
}
|
||||
|
||||
# Make sure all requirements for Sysprep are met, if Sysprep is enabled
|
||||
if ($script:Params.ContainsKey("Sysprep")) {
|
||||
$defaultUserPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), '\Default\NTUSER.DAT'
|
||||
$defaultUserPath = GetUserDirectory -userName "Default"
|
||||
|
||||
# Exit script if default user directory or NTUSER.DAT file cannot be found
|
||||
if (-not (Test-Path "$defaultUserPath")) {
|
||||
Write-Host "Error: Unable to start Win11Debloat in Sysprep mode, cannot find default user folder at '$defaultUserPath'" -ForegroundColor Red
|
||||
AwaitKeyToExit
|
||||
}
|
||||
# Exit script if run in Sysprep mode on Windows 10
|
||||
if ($WinVersion -lt 22000) {
|
||||
Write-Host "Error: Win11Debloat Sysprep mode is not supported on Windows 10" -ForegroundColor Red
|
||||
@@ -1331,13 +1396,7 @@ if ($script:Params.ContainsKey("Sysprep")) {
|
||||
|
||||
# Make sure all requirements for User mode are met, if User is specified
|
||||
if ($script:Params.ContainsKey("User")) {
|
||||
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$($script:Params.Item("User"))\NTUSER.DAT"
|
||||
|
||||
# Exit script if user directory or NTUSER.DAT file cannot be found
|
||||
if (-not (Test-Path "$userPath")) {
|
||||
Write-Host "Error: Unable to run Win11Debloat for user $($script:Params.Item("User")), cannot find user data at '$userPath'" -ForegroundColor Red
|
||||
AwaitKeyToExit
|
||||
}
|
||||
$userPath = GetUserDirectory -userName $script:Params.Item("User")
|
||||
}
|
||||
|
||||
# Remove SavedSettings file if it exists and is empty
|
||||
@@ -1443,6 +1502,11 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or $RunS
|
||||
if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") -and (-not $script:Params.ContainsKey('Hide3dObjects'))) {
|
||||
$script:Params.Add('Hide3dObjects', $Hide3dObjects)
|
||||
}
|
||||
|
||||
# Only add this option for Windows 11 users (build 22000+), if it doesn't already exist
|
||||
if (($WinVersion -ge 22000) -and $script:ModernStandbySupported -and (-not $script:Params.ContainsKey('DisableModernStandbyNetworking'))) {
|
||||
$script:Params.Add('DisableModernStandbyNetworking', $true)
|
||||
}
|
||||
}
|
||||
|
||||
# Custom mode, show & add options based on user input
|
||||
@@ -1671,6 +1735,10 @@ switch ($script:Params.Keys) {
|
||||
RegImport "> Disabling Fast Start-up..." "Disable_Fast_Startup.reg"
|
||||
continue
|
||||
}
|
||||
'DisableModernStandbyNetworking' {
|
||||
RegImport "> Disabling network connectivity during Modern Standby..." "Disable_Modern_Standby_Networking.reg"
|
||||
continue
|
||||
}
|
||||
'ClearStart' {
|
||||
Write-Output "> Removing all pinned apps from the start menu for user $(GetUserName)..."
|
||||
ReplaceStartMenu
|
||||
@@ -1736,7 +1804,7 @@ switch ($script:Params.Keys) {
|
||||
continue
|
||||
}
|
||||
{$_ -in "HideWidgets", "DisableWidgets"} {
|
||||
RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." "Disable_Widgets_Taskbar.reg"
|
||||
RegImport "> Disabling widgets on the taskbar & lockscreen..." "Disable_Widgets_Service.reg"
|
||||
|
||||
# Also remove the app package for Widgets
|
||||
$appsList = 'Microsoft.StartExperiencesApp'
|
||||
|
||||
Reference in New Issue
Block a user