#Requires -RunAsAdministrator
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
# --- Registry helpers ---
function Get-OldStartEnabled {
$path = "HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\8\3036241548"
if (Test-Path $path) {
try {
$state = Get-ItemPropertyValue -Path $path -Name EnabledState -ErrorAction SilentlyContinue
if ($state -eq 1) { return $true }
} catch {}
}
return $false
}
function Clear-FeatureManagementCache {
$stores = @(
'HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Store',
'HKLM:\SYSTEM\CurrentControlSet\Control\FeatureManagement\Store'
)
foreach ($s in $stores) {
if (Test-Path $s) {
Remove-Item $s -Recurse -Force -ErrorAction SilentlyContinue
}
}
Stop-Service -Name "StateRepository" -Force -ErrorAction SilentlyContinue
Start-Service -Name "StateRepository" -ErrorAction SilentlyContinue
}
function Set-OldStart {
# Remove all override branches
$branches = @('2','4','6','8','10','12','14')
foreach ($branch in $branches) {
$path = "HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\$branch\3036241548"
if (Test-Path $path) { Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue }
}
# Create parent key
$parent = "HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\8"
if (-not (Test-Path $parent)) { New-Item -Path $parent -Force | Out-Null }
# Create override key
$override = "$parent\3036241548"
if (-not (Test-Path $override)) { New-Item -Path $override -Force | Out-Null }
# Apply values
New-ItemProperty -Path $override -Name "EnabledState" -Value 1 -PropertyType DWord -Force | Out-Null
New-ItemProperty -Path $override -Name "EnabledStateOptions" -Value 0 -PropertyType DWord -Force | Out-Null
Clear-FeatureManagementCache
}
function Set-NewStart {
# Remove override branches
$branches = @('2','4','6','8','10','12','14')
foreach ($branch in $branches) {
$path = "HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\$branch"
if (Test-Path $path) { Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue }
}
# Create parent branch 14
$parent = "HKLM:\SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\14"
if (-not (Test-Path $parent)) { New-Item -Path $parent -Force | Out-Null }
# IDs from reg
$ids = @(
'156965516',
'3036241548',
'1853569164',
'2792562829',
'762256525',
'734731404',
'2114784909',
'905601679'
)
foreach ($id in $ids) {
$key = "$parent\$id"
if (-not (Test-Path $key)) { New-Item -Path $key -Force | Out-Null }
New-ItemProperty -Path $key -Name "EnabledState" -Value 2 -PropertyType DWord -Force | Out-Null
New-ItemProperty -Path $key -Name "EnabledStateOptions" -Value 0 -PropertyType DWord -Force | Out-Null
}
Clear-FeatureManagementCache
}
# --- GUI ---
$form = New-Object System.Windows.Forms.Form
$form.Text = "Start Menu Toggle"
$form.Size = New-Object System.Drawing.Size(360,200)
$form.StartPosition = "CenterScreen"
$form.FormBorderStyle = "FixedDialog"
$form.MaximizeBox = $false
$form.MinimizeBox = $false
$label = New-Object System.Windows.Forms.Label
$label.Text = "Choose Start menu style:"
$label.AutoSize = $true
$label.Location = New-Object System.Drawing.Point(20,20)
$form.Controls.Add($label)
$radioNew = New-Object System.Windows.Forms.RadioButton
$radioNew.Text = "New Start menu (Windows 11 default)"
$radioNew.AutoSize = $true
$radioNew.Location = New-Object System.Drawing.Point(40,50)
$form.Controls.Add($radioNew)
$radioOld = New-Object System.Windows.Forms.RadioButton
$radioOld.Text = "Old Start menu (override)"
$radioOld.AutoSize = $true
$radioOld.Location = New-Object System.Drawing.Point(40,80)
$form.Controls.Add($radioOld)
$buttonApply = New-Object System.Windows.Forms.Button
$buttonApply.Text = "Apply"
$buttonApply.Size = New-Object System.Drawing.Size(80,30)
$buttonApply.Location = New-Object System.Drawing.Point(80,120)
$form.Controls.Add($buttonApply)
$buttonCancel = New-Object System.Windows.Forms.Button
$buttonCancel.Text = "Cancel"
$buttonCancel.Size = New-Object System.Drawing.Size(80,30)
$buttonCancel.Location = New-Object System.Drawing.Point(180,120)
$form.Controls.Add($buttonCancel)
# Pre-select based on current state
if (Get-OldStartEnabled) {
$radioOld.Checked = $true
} else {
$radioNew.Checked = $true
}
$buttonApply.Add_Click({
if (-not $radioNew.Checked -and -not $radioOld.Checked) {
[System.Windows.Forms.MessageBox]::Show(
"Select New or Old Start menu first.",
"Start Menu Toggle",
[System.Windows.Forms.MessageBoxButtons]::OK,
[System.Windows.Forms.MessageBoxIcon]::Warning
) | Out-Null
return
}
try {
if ($radioOld.Checked) {
Set-OldStart
} else {
Set-NewStart
}
} catch {
[System.Windows.Forms.MessageBox]::Show(
"Failed to write registry. Run as Administrator.",
"Error",
[System.Windows.Forms.MessageBoxButtons]::OK,
[System.Windows.Forms.MessageBoxIcon]::Error
) | Out-Null
return
}
$result = [System.Windows.Forms.MessageBox]::Show(
"Changes applied. A reboot is required for the Start menu to switch.`nReboot now?",
"Reboot required",
[System.Windows.Forms.MessageBoxButtons]::YesNo,
[System.Windows.Forms.MessageBoxIcon]::Question
)
if ($result -eq [System.Windows.Forms.DialogResult]::Yes) {
$form.Close()
Restart-Computer -Force
} else {
$form.Close()
}
})
$buttonCancel.Add_Click({
$form.Close()
})
[void]$form.ShowDialog()