diff --git a/Assets/Menus/DefaultSettings b/Assets/Menus/DefaultSettings index f9e36a4..c3841b2 100644 --- a/Assets/Menus/DefaultSettings +++ b/Assets/Menus/DefaultSettings @@ -7,6 +7,7 @@ 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. diff --git a/Assets/Menus/Info b/Assets/Menus/Info index 3985bfd..ba435f5 100644 --- a/Assets/Menus/Info +++ b/Assets/Menus/Info @@ -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. diff --git a/Get.ps1 b/Get.ps1 index 68a056f..cc0edb3 100644 --- a/Get.ps1 +++ b/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, diff --git a/README.md b/README.md index 6e80de7..a1c22a3 100644 --- a/README.md +++ b/README.md @@ -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,6 +171,7 @@ 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. diff --git a/Regfiles/Disable_Modern_Standby_Networking.reg b/Regfiles/Disable_Modern_Standby_Networking.reg new file mode 100644 index 0000000..d13daea --- /dev/null +++ b/Regfiles/Disable_Modern_Standby_Networking.reg @@ -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 \ No newline at end of file diff --git a/Regfiles/Sysprep/Disable_Modern_Standby_Networking.reg b/Regfiles/Sysprep/Disable_Modern_Standby_Networking.reg new file mode 100644 index 0000000..d13daea --- /dev/null +++ b/Regfiles/Sysprep/Disable_Modern_Standby_Networking.reg @@ -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 \ No newline at end of file diff --git a/Regfiles/Undo/Enable_Modern_Standby_Networking.reg b/Regfiles/Undo/Enable_Modern_Standby_Networking.reg new file mode 100644 index 0000000..5a0f99b --- /dev/null +++ b/Regfiles/Undo/Enable_Modern_Standby_Networking.reg @@ -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 \ No newline at end of file diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index ab3a6a4..0ab4289 100644 --- a/Win11Debloat.ps1 +++ b/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, @@ -1006,6 +1007,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:BatteryInstalled) { + Write-Output "" + + if ($( Read-Host -Prompt "Disable network connectivity during Modern Standby to reduce battery drain? (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 "" @@ -1287,6 +1297,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 has a battery installed, this is used to determine if the DisableModernStandbyNetworking option can be used +$script:BatteryInstalled = (Get-WmiObject -Class Win32_Battery).Count -gt 0 + $script:Params = $PSBoundParameters $script:FirstSelection = $true $SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep', 'Debug', 'User', 'CreateRestorePoint', 'LogPath' @@ -1443,6 +1456,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:BatteryInstalled -and (-not $script:Params.ContainsKey('DisableModernStandbyNetworking'))) { + $script:Params.Add('DisableModernStandbyNetworking', $true) + } } # Custom mode, show & add options based on user input @@ -1671,6 +1689,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