通过PowerShell修改Windows桌面(开始菜单、通知、任务管理器等)设置问题咨询
可行PowerShell实现方案
1. 取消固定开始菜单中的分组
原方案缺失注册表路径匹配修正和资源管理器重启步骤,修正后代码:
# 匹配正确的开始菜单磁贴配置注册表项 Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" | Where-Object {$_.PSChildName -match "start\.tilegrid.*curatedtilecollection\.tilecollection"} | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue # 重启资源管理器使配置生效 Stop-Process -Name explorer -Force
注:执行后所有已固定的开始菜单磁贴会被清空,无分组状态默认生效
2. 通知区域快速操作展开设置
原方案仅修改了快速操作开关状态,补充展开控制项:
# 设置快速操作默认全部展开 Set-ItemProperty -Path "HKCU:\Control Panel\Quick Actions\Control Center\QuickActionsStateCapture" -Name "IsQuickActionsExpanded" -Type DWord -Value 1 -Force # 按需关闭不需要的快速操作按钮 Set-ItemProperty -Path "HKCU:\Control Panel\Quick Actions\Control Center\QuickActionsStateCapture" -Name "Toggles" -Type String -Value "Toggles,Microsoft.QuickAction.Location:false,Microsoft.QuickAction.BlueLightReduction:false,Microsoft.QuickAction.AllSettings:false,Microsoft.QuickAction.AvailableNetworks:false,Microsoft.QuickAction.Connect:false,Microsoft.QuickAction.Project:false,Microsoft.QuickAction.Vpn:false,Microsoft.QuickAction.QuietHours:false,Microsoft.QuickAction.ScreenClipping:false" -Force # 重启资源管理器生效 Stop-Process -Name explorer -Force
3. 任务管理器默认配置修改
原方案使用系统级注册表路径权限要求高,改为用户级路径:
# 确保注册表路径存在 New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Force | Out-Null # 设置默认启动选项卡:1=性能选项卡 Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "StartUpTab" -Type DWord -Value 1 -Force # 设置默认打开更多详情视图,且性能页CPU默认显示逻辑处理器 $pref = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue if (-not $pref) { # 无配置时生成默认更多详情+逻辑处理器视图的二进制值 $binary = [byte[]]@(0x02,0x00,0x00,0x00,0x90,0x05,0x00,0x00,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00) } else { $binary = $pref.Preferences # 修改首字节为0x02开启更多详情+逻辑处理器视图 $binary[0] = 0x02 } Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $binary -Force # 重启任务管理器生效 Get-Process Taskmgr -ErrorAction SilentlyContinue | Stop-Process -Force
4. 系统语言配置
原方案缺失组件安装步骤,修正后支持自动下载语言包及附属组件:
# 需以管理员权限执行 # 安装目标语言包及手写、语音等全部附属组件 Install-Language -Language de-CH -IncludeAllFeatures # 生成仅保留目标语言的列表 $langList = New-WinUserLanguageList -Language de-CH # 覆盖现有语言列表 Set-WinUserLanguageList $langList -Force # 设置系统默认显示语言为目标语言 Set-SystemPreferredUILanguage -Language de-CH # 重启系统生效 Restart-Computer
注:若需使用本地cab包安装,可保留原来的Add-WindowsPackage步骤,执行后再运行上述配置代码即可
内容的提问来源于stack exchange,提问作者MisterDeeds
相关产品推荐
相关产品推荐

