mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Add Disable Modern Standby networking to prevent battery drain (#288)
This commit is contained in:
@@ -7,6 +7,7 @@ Win11Debloat will make the following changes:
|
|||||||
- Disable & remove Bing web search, Bing AI and Cortana from Windows search.
|
- Disable & remove Bing web search, Bing AI and Cortana from Windows search.
|
||||||
- Disable & remove Microsoft Copilot. (W11 only)
|
- Disable & remove Microsoft Copilot. (W11 only)
|
||||||
- Disable Fast Start-up to ensure a full shutdown.
|
- 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.
|
- Show file extensions for known file types.
|
||||||
- Hide the 3D objects folder in Windows Explorer. (W10 only)
|
- Hide the 3D objects folder in Windows Explorer. (W10 only)
|
||||||
- Disable the widget service & hide the icon from the taskbar.
|
- Disable the widget service & hide the icon from the taskbar.
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ Start
|
|||||||
Other
|
Other
|
||||||
- Disable Xbox game/screen recording, this also stops gaming overlay popups.
|
- Disable Xbox game/screen recording, this also stops gaming overlay popups.
|
||||||
- Disable Fast Start-up to ensure a full shutdown.
|
- 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.
|
- 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.
|
- Sysprep mode to apply changes to the Windows Default user profile.
|
||||||
|
|
||||||
|
|||||||
1
Get.ps1
1
Get.ps1
@@ -19,6 +19,7 @@ param (
|
|||||||
[switch]$DisableDVR,
|
[switch]$DisableDVR,
|
||||||
[switch]$DisableTelemetry,
|
[switch]$DisableTelemetry,
|
||||||
[switch]$DisableFastStartup,
|
[switch]$DisableFastStartup,
|
||||||
|
[switch]$DisableModernStandbyNetworking,
|
||||||
[switch]$DisableBingSearches, [switch]$DisableBing,
|
[switch]$DisableBingSearches, [switch]$DisableBing,
|
||||||
[switch]$DisableDesktopSpotlight,
|
[switch]$DisableDesktopSpotlight,
|
||||||
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
||||||
|
|||||||
@@ -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 Xbox game/screen recording, this also stops gaming overlay popups.
|
||||||
- Disable Fast Start-up to ensure a full shutdown.
|
- 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.
|
- 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.
|
- [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 Bing web search, Bing AI and Cortana from Windows search.
|
||||||
- Disable & remove Microsoft Copilot. (W11 only)
|
- Disable & remove Microsoft Copilot. (W11 only)
|
||||||
- Disable Fast Start-up to ensure a full shutdown.
|
- 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.
|
- Show file extensions for known file types.
|
||||||
- Hide the 3D objects folder under 'This pc' from File Explorer. (W10 only)
|
- Hide the 3D objects folder under 'This pc' from File Explorer. (W10 only)
|
||||||
- Disable the widget service & hide the icon from the taskbar.
|
- Disable the widget service & hide the icon from the taskbar.
|
||||||
|
|||||||
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
|
||||||
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
|
||||||
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
|
||||||
@@ -21,6 +21,7 @@ param (
|
|||||||
[switch]$DisableDVR,
|
[switch]$DisableDVR,
|
||||||
[switch]$DisableTelemetry,
|
[switch]$DisableTelemetry,
|
||||||
[switch]$DisableFastStartup,
|
[switch]$DisableFastStartup,
|
||||||
|
[switch]$DisableModernStandbyNetworking,
|
||||||
[switch]$DisableBingSearches, [switch]$DisableBing,
|
[switch]$DisableBingSearches, [switch]$DisableBing,
|
||||||
[switch]$DisableDesktopSpotlight,
|
[switch]$DisableDesktopSpotlight,
|
||||||
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
||||||
@@ -1006,6 +1007,15 @@ function DisplayCustomModeOptions {
|
|||||||
AddParameter 'DisableFastStartup' 'Disable Fast Start-up'
|
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
|
# 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')) {
|
if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") -or $script:Params.ContainsKey('RevertContextMenu')) {
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
@@ -1287,6 +1297,9 @@ else {
|
|||||||
# Get current Windows build version to compare against features
|
# Get current Windows build version to compare against features
|
||||||
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
$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:Params = $PSBoundParameters
|
||||||
$script:FirstSelection = $true
|
$script:FirstSelection = $true
|
||||||
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep', 'Debug', 'User', 'CreateRestorePoint', 'LogPath'
|
$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'))) {
|
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)
|
$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
|
# 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"
|
RegImport "> Disabling Fast Start-up..." "Disable_Fast_Startup.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
'DisableModernStandbyNetworking' {
|
||||||
|
RegImport "> Disabling network connectivity during Modern Standby..." "Disable_Modern_Standby_Networking.reg"
|
||||||
|
continue
|
||||||
|
}
|
||||||
'ClearStart' {
|
'ClearStart' {
|
||||||
Write-Output "> Removing all pinned apps from the start menu for user $(GetUserName)..."
|
Write-Output "> Removing all pinned apps from the start menu for user $(GetUserName)..."
|
||||||
ReplaceStartMenu
|
ReplaceStartMenu
|
||||||
|
|||||||
Reference in New Issue
Block a user