From 88f841a44ba199e2f5a03eec733fb1ca20321498 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Mon, 19 May 2025 00:01:49 +0200 Subject: [PATCH] Added option to replace the start menu with your own template --- Assets/Menus/Info | 2 +- Get.ps1 | 2 ++ README.md | 2 +- Win11Debloat.ps1 | 20 ++++++++++++++++---- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Assets/Menus/Info b/Assets/Menus/Info index 4902fe4..7203080 100644 --- a/Assets/Menus/Info +++ b/Assets/Menus/Info @@ -8,7 +8,7 @@ all the settings yourself, or remove apps one by one. ------------------------------------------------------------------------------------------- App Removal - Remove a wide variety of bloatware apps. -- Remove all pinned apps from start for the current user, or for all existing & new users. (W11 only) +- Remove or replace all pinned apps from start for the current user, or for all existing & new users. (W11 only) Telemetry, Tracking & Suggested Content - Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads. diff --git a/Get.ps1 b/Get.ps1 index 1310a63..cf357fe 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -36,7 +36,9 @@ param ( [switch]$DisableChat, [switch]$HideChat, [switch]$EnableEndTask, [switch]$ClearStart, + [string]$ReplaceStart, [switch]$ClearStartAllUsers, + [string]$ReplaceStartAllUsers, [switch]$RevertContextMenu, [switch]$DisableMouseAcceleration, [switch]$DisableStickyKeys, diff --git a/README.md b/README.md index c7c2173..cba7d77 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Below is an overview of the key features and functionality offered by Win11Deblo #### App Removal - Remove a wide variety of preinstalled apps. Click [here](https://github.com/Raphire/Win11Debloat/wiki/App-Removal) for more info. -- Remove all pinned apps from start for the current user, or for all existing & new users. (Windows 11 only) +- Remove or replace all pinned apps from start for the current user, or for all existing & new users. (Windows 11 only) #### Telemetry, Tracking & Suggested Content diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 156b8a4..70e91cc 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -38,7 +38,9 @@ param ( [switch]$DisableChat, [switch]$HideChat, [switch]$EnableEndTask, [switch]$ClearStart, + [string]$ReplaceStart, [switch]$ClearStartAllUsers, + [string]$ReplaceStartAllUsers, [switch]$RevertContextMenu, [switch]$DisableMouseAcceleration, [switch]$DisableStickyKeys, @@ -632,8 +634,8 @@ function ReplaceStartMenuForAllUsers { # Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/ function ReplaceStartMenu { param ( - $startMenuBinFile = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin", - $startMenuTemplate = "$PSScriptRoot/Start/start2.bin" + $startMenuTemplate = "$PSScriptRoot/Start/start2.bin", + $startMenuBinFile = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin" ) # Change path to correct user if a user was specified @@ -643,13 +645,13 @@ function ReplaceStartMenu { # Check if template bin file exists, return early if it doesn't if (-not (Test-Path $startMenuTemplate)) { - Write-Host "Error: Unable to clear start menu, start2.bin file missing from script folder" -ForegroundColor Red + Write-Host "Error: Unable to replace start menu, template start2.bin file not found" -ForegroundColor Red return } # Check if bin file exists, return early if it doesn't if (-not (Test-Path $startMenuBinFile)) { - Write-Host "Error: Unable to clear start menu for user $(GetUserName), start2.bin file could not found" -ForegroundColor Red + Write-Host "Error: Unable to replace start menu for user $(GetUserName), template start2.bin file not found" -ForegroundColor Red return } @@ -1553,10 +1555,20 @@ switch ($script:Params.Keys) { Write-Output "" continue } + 'ReplaceStart' { + Write-Output "> Replacing the start menu for user $(GetUserName)..." + ReplaceStartMenu $script:Params.Item("ReplaceStart") + Write-Output "" + continue + } 'ClearStartAllUsers' { ReplaceStartMenuForAllUsers continue } + 'ReplaceStartAllUsers' { + ReplaceStartMenuForAllUsers $script:Params.Item("ReplaceStartAllUsers") + continue + } 'DisableStartRecommended' { RegImport "> Disabling and hiding the start menu recommended section..." "Disable_Start_Recommended.reg" continue