# ========================================================= # MAX Windows Toolkit - 管理开机启动项 # ========================================================= $Common = "C:\Setup\windows\lib\common.ps1" if (Test-Path $Common) { . $Common } Show-AdminWarn Write-Header "管理开机启动项" function Show-StartupItems { Write-Section "当前用户启动项 (HKCU)" Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -ErrorAction SilentlyContinue | Format-List Write-Section "全局启动项 (HKLM)" Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -ErrorAction SilentlyContinue | Format-List } function Disable-CommonStartupItems { $StartupNames = @( "OneDrive", "WeChat", "QQ", "WPS Office", "WPS Cloud", "AdobeAAMUpdater", "Adobe Acrobat Synchronizer", "SogouImeMgr" ) foreach ($Name in $StartupNames) { try { reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "$Name" /f 2>$null reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "$Name" /f 2>$null Write-OK "已移除开机启动项: $Name" } catch { Write-Muted "跳过: $Name" } } Write-Line Write-OK "常见启动项清理完成" } Write-Info "1. 查看启动项" Write-Info "2. 禁用常见不必要的启动项" Write-Line $Choice = Read-Host " 请选择" switch ($Choice) { "1" { Show-StartupItems } "2" { Disable-CommonStartupItems } default { Write-Err "无效选项" } } Write-Line Write-OK "启动项管理完成" Pause-Max