6 Commits

Author SHA1 Message Date
Raphire
6c4b401a21 Update Get.ps1 to new release 2025-09-07 19:26:51 +02:00
Raphire
75f71972b3 Update wording around DisableWidgets feature #302
To clarify this feature also disables widgets on the lockscreen.
2025-09-07 19:13:51 +02:00
Raphire
c3de7803ae Fix dark mode not applying correctly in Sysprep mode 2025-09-07 17:51:25 +02:00
Raphire
8ce501511f Fix script not using correct user directory paths when run as system account #310 2025-09-07 15:04:29 +02:00
Jeffrey
a65548b9b7 Properly check if Modern Standby is supported (#298)
Using `powercfg /a` output instead of checking for battery
2025-08-22 17:50:47 +02:00
Sashank
98b9348b70 Add DisableBackupNotifications parameter (#297) 2025-08-20 20:15:50 +02:00
12 changed files with 45 additions and 29 deletions

View File

@@ -10,7 +10,7 @@ Win11Debloat will make the following changes:
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) - 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 widgets on the taskbar & lockscreen.
- Hide the Chat (meet now) icon from the taskbar. - Hide the Chat (meet now) icon from the taskbar.

View File

@@ -42,7 +42,7 @@ Taskbar
- Align taskbar icons to the left. (W11 only) - Align taskbar icons to the left. (W11 only)
- Hide or change the search icon/box on the taskbar. (W11 only) - Hide or change the search icon/box on the taskbar. (W11 only)
- Hide the taskview button from 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. - Hide the chat (meet now) icon from the taskbar.
- Enable the 'End Task' option in the taskbar right click menu. (W11 only) - Enable the 'End Task' option in the taskbar right click menu. (W11 only)
- Enable the 'Last Active Click' behavior in the taskbar app area. - Enable the 'Last Active Click' behavior in the taskbar app area.

View File

@@ -85,7 +85,7 @@ Write-Output "------------------------------------------------------------------
Write-Output "> Downloading Win11Debloat..." Write-Output "> Downloading Win11Debloat..."
# Download latest version of Win11Debloat from github as zip archive # 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.07 -OutFile "$env:TEMP/win11debloat.zip"
# Remove old script folder if it exists, except for CustomAppsList and SavedSettings files # Remove old script folder if it exists, except for CustomAppsList and SavedSettings files
if (Test-Path "$env:TEMP/Win11Debloat") { if (Test-Path "$env:TEMP/Win11Debloat") {

View File

@@ -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) - Align taskbar icons to the left. (W11 only)
- Hide or change the search icon/box on the taskbar. (W11 only) - Hide or change the search icon/box on the taskbar. (W11 only)
- Hide the taskview button from 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. - Hide the chat (meet now) icon from the taskbar.
- Enable the 'End Task' option in the taskbar right click menu. (W11 only) - 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. - 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.
@@ -174,7 +174,7 @@ Win11Debloat offers a default mode that allows you to quickly and easily apply t
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) - 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 widgets on the taskbar & lockscreen.
- Hide the Chat (meet now) icon from the taskbar. - Hide the Chat (meet now) icon from the taskbar.
#### Apps that ARE removed as part of the default mode #### Apps that ARE removed as part of the default mode

View File

@@ -3,3 +3,7 @@ Windows Registry Editor Version 5.00
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize] [hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize]
"AppsUseLightTheme"=dword:00000000 "AppsUseLightTheme"=dword:00000000
"SystemUsesLightTheme"=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"

View File

@@ -571,6 +571,28 @@ function CheckModernStandbySupport {
} }
# Returns the directory path of the specified user, exits script if user path can't be found
function GetUserDirectory {
param (
$userName,
$fileName = ""
)
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
if (-not (Test-Path $userPath)) {
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName\$fileName"
}
if (-not (Test-Path $userPath)) {
Write-Host "Error: Unable to find user directory path for user $userName" -ForegroundColor Red
AwaitKeyToExit
}
return $userPath
}
# Import & execute regfile # Import & execute regfile
function RegImport { function RegImport {
param ( param (
@@ -581,14 +603,14 @@ function RegImport {
Write-Output $message Write-Output $message
if ($script:Params.ContainsKey("Sysprep")) { 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 load "HKU\Default" $defaultUserPath | Out-Null
reg import "$PSScriptRoot\Regfiles\Sysprep\$path" reg import "$PSScriptRoot\Regfiles\Sysprep\$path"
reg unload "HKU\Default" | Out-Null reg unload "HKU\Default" | Out-Null
} }
elseif ($script:Params.ContainsKey("User")) { 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 load "HKU\Default" $userPath | Out-Null
reg import "$PSScriptRoot\Regfiles\Sysprep\$path" reg import "$PSScriptRoot\Regfiles\Sysprep\$path"
@@ -651,7 +673,7 @@ function ReplaceStartMenuForAllUsers {
} }
# Get path to start menu file for all users # 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 $usersStartMenuPaths = get-childitem -path $userPathString
# Go through all users and replace the start menu file # Go through all users and replace the start menu file
@@ -660,7 +682,7 @@ function ReplaceStartMenuForAllUsers {
} }
# Also replace the start menu file for the default user profile # 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"
# Create folder if it doesn't exist # Create folder if it doesn't exist
if (-not (Test-Path $defaultStartMenuPath)) { if (-not (Test-Path $defaultStartMenuPath)) {
@@ -685,7 +707,7 @@ function ReplaceStartMenu {
# Change path to correct user if a user was specified # Change path to correct user if a user was specified
if ($script:Params.ContainsKey("User")) { 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 # Check if template bin file exists, return early if it doesn't
@@ -699,9 +721,11 @@ function ReplaceStartMenu {
return return
} }
$userName = [regex]::Match($startMenuBinFile, '(?:Users\\)([^\\]+)(?:\\AppData)').Groups[1].Value
# Check if bin file exists, return early if it doesn't # Check if bin file exists, return early if it doesn't
if (-not (Test-Path $startMenuBinFile)) { 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 return
} }
@@ -713,7 +737,7 @@ function ReplaceStartMenu {
# Copy template file # Copy template file
Copy-Item -Path $startMenuTemplate -Destination $startMenuBinFile -Force Copy-Item -Path $startMenuTemplate -Destination $startMenuBinFile -Force
Write-Output "Replaced start menu for user $(GetUserName)" Write-Output "Replaced start menu for user $userName"
} }
@@ -1166,8 +1190,8 @@ function DisplayCustomModeOptions {
Write-Output "" Write-Output ""
if ($( Read-Host -Prompt " Disable the widgets service and hide the icon from the taskbar? (y/n)" ) -eq 'y') { if ($( Read-Host -Prompt " Disable the widgets service to remove widgets on the taskbar & lockscreen? (y/n)" ) -eq 'y') {
AddParameter 'DisableWidgets' 'Disable the widget service & hide the widget (news and interests) icon from the taskbar' AddParameter 'DisableWidgets' 'Disable widgets on the taskbar & lockscreen'
} }
# Only show this options for Windows users running build 22621 or earlier # Only show this options for Windows users running build 22621 or earlier
@@ -1355,15 +1379,9 @@ else {
$ProgressPreference = 'Continue' $ProgressPreference = 'Continue'
} }
# Make sure all requirements for Sysprep are met, if Sysprep is enabled
if ($script:Params.ContainsKey("Sysprep")) { 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 # Exit script if run in Sysprep mode on Windows 10
if ($WinVersion -lt 22000) { if ($WinVersion -lt 22000) {
Write-Host "Error: Win11Debloat Sysprep mode is not supported on Windows 10" -ForegroundColor Red Write-Host "Error: Win11Debloat Sysprep mode is not supported on Windows 10" -ForegroundColor Red
@@ -1373,13 +1391,7 @@ if ($script:Params.ContainsKey("Sysprep")) {
# Make sure all requirements for User mode are met, if User is specified # Make sure all requirements for User mode are met, if User is specified
if ($script:Params.ContainsKey("User")) { if ($script:Params.ContainsKey("User")) {
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$($script:Params.Item("User"))\NTUSER.DAT" $userPath = GetUserDirectory -userName $script:Params.Item("User")
# 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
}
} }
# Remove SavedSettings file if it exists and is empty # Remove SavedSettings file if it exists and is empty
@@ -1787,7 +1799,7 @@ switch ($script:Params.Keys) {
continue continue
} }
{$_ -in "HideWidgets", "DisableWidgets"} { {$_ -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 # Also remove the app package for Widgets
$appsList = 'Microsoft.StartExperiencesApp' $appsList = 'Microsoft.StartExperiencesApp'