#Requires -Version 7.0 <# .SYNOPSIS 移除 install-explorer-menu.ps1 注册的右键菜单(重命名 + 归档)。 .EXAMPLE .\uninstall-explorer-menu.ps1 #> [CmdletBinding()] param() $ErrorActionPreference = 'Stop' $keyNames = @('SceneMarshal', 'SceneMarshalArchive') $shells = @( 'HKCU:\Software\Classes\Directory\shell', 'HKCU:\Software\Classes\Directory\Background\shell', 'HKCU:\Software\Classes\SystemFileAssociations\.mkv\shell', 'HKCU:\Software\Classes\SystemFileAssociations\.mp4\shell', 'HKCU:\Software\Classes\SystemFileAssociations\.avi\shell' ) $removed = 0 foreach ($shell in $shells) { foreach ($name in $keyNames) { $key = Join-Path $shell $name if (Test-Path -LiteralPath $key) { Remove-Item -LiteralPath $key -Recurse -Force $removed++ Write-Host " - 已移除 $key" -ForegroundColor DarkGray } } } Write-Host "✔ 右键菜单已清理($removed 项)" -ForegroundColor Green