I haven't used this yet but plan to on the next Win 11 implementation.
The .bat file to run the .ps1
Paste the following into a notepad and save as Run-Clear-StartMenu.bat
@echo off
:: ============================================================================
:: Self-Elevation Section: Check for Admin rights and relaunch if needed.
:: ============================================================================
fsutil dirty query %systemdrive% >nul
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell.exe -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:: ============================================================================
:: Main script execution (only runs if we have Admin rights).
:: ============================================================================
TITLE Running PowerShell Script (As Administrator)
REM The core command:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Clear-StartMenu.ps1"
echo.
echo Script has finished.
pause
@echo off
REM This batch file will execute a PowerShell script without permanently changing the Execution Policy.
REM Set the title of the command window for clarity.
TITLE Running PowerShell Script...
REM The core command:
powershell.eXE -NoProfile -ExecutionPolicy Bypass -File "%~dp0Clear-StartMenu.ps1"
REM Pause to see the output. Remove this line if you want the window to close automatically.
echo.
pause
The .ps1 script to clean the pinned items
Paste the following into a notepad and save as Clear-StartMenu.ps1
<#
.SYNOPSIS
Unpins the default "bloatware" and common apps from the Windows 11 Start Menu.
This script is safe to run multiple times. It only acts on items that are currently pinned.
.DESCRIPTION
The script gets a list of all items pinned to the Start Menu. It then compares that list
against a customizable array of app names ($appsToUnpin). If a match is found, it
programmatically invokes the "Unpin from Start" verb, effectively right-clicking and
unpinning it for you.
.NOTES
Author: Community-Sourced (refined for clarity)
Run this in a PowerShell 7 Terminal (Admin) for best results.
#>
# --- EDIT THIS LIST ---
# Add or remove app names to control what gets unpinned.
# You don't need the exact name, a unique part of it is usually enough (e.g., "Xbox" instead of "Xbox Game Bar").
$appsToUnpin = @(
"Microsoft Edge",
"Mail",
"Calendar",
"Microsoft Store",
"Photos",
"Your Phone",
"Xbox",
"Get Help",
"Tips",
"Solitaire",
"Spotify",
"Netflix",
"Prime Video",
"TikTok",
"Instagram",
"Facebook",
"Messenger",
"Movies & TV",
"Weather",
"Clock",
"To Do",
"Whiteboard",
"Clipchamp",
"Family",
"Cortana"
)
# You can also unpin useful tools if you want a completely blank slate.
# To do this, uncomment the line below by removing the '#' at the beginning.
# $appsToUnpin += @("File Explorer", "Settings", "Calculator", "Notepad", "Paint")
# --- SCRIPT LOGIC (No need to edit below here) ---
Write-Host "Attempting to unpin default Start Menu apps..." -ForegroundColor Cyan
try {
# This is the magic command to access the Start Menu's pinned items folder.
$startMenuPins = (New-Object -ComObject Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items()
if (!$startMenuPins) {
throw "Could not access the Start Menu pinned items."
}
# Loop through each app name in our list.
foreach ($appName in $appsToUnpin) {
# Find the corresponding pinned item. The wildcard '*' helps match partial names.
$itemToUnpin = $startMenuPins | Where-Object { $_.Name -like "*$appName*" }
if ($itemToUnpin) {
# Find the "Unpin from Start" action for that item.
$unpinVerb = $itemToUnpin.Verbs() | Where-Object { $_.Name -eq "Unpin from Start" }
if ($unpinVerb) {
# Execute the action.
$unpinVerb.DoIt()
Write-Host " [SUCCESS] Unpinned '$($itemToUnpin.Name)'" -ForegroundColor Green
}
}
else {
# This part is just for information, it will show which apps were not found (likely already unpinned).
# Write-Host " [INFO] '$appName' was not found or already unpinned." -ForegroundColor Gray
}
}
Write-Host "Script finished." -ForegroundColor Cyan
}
catch {
Write-Host "An error occurred: $($_.Exception.Message)" -ForegroundColor Red
}