From a7975343c30e9452a5f27bc597a944399ccbbff1 Mon Sep 17 00:00:00 2001 From: Timmy Date: Tue, 28 Apr 2026 08:58:50 +0800 Subject: [PATCH] =?UTF-8?q?07=EF=BC=9A=E5=9C=A8=E6=A1=8C=E9=9D=A2=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA=E3=80=8C=E6=9C=AC=E6=A9=9F=E3=80=8D=E8=88=87=E3=80=8C?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E3=80=8D=EF=BC=88Default=20profile?= =?UTF-8?q?=20+=20=E5=B7=B2=E8=BC=89=E5=85=A5=20user=20hive=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 寫到 HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons 底下的 NewStartPanel + ClassicStartMenu 兩個 key(NewStartPanel 是 Win11 用、 ClassicStartMenu 為相容性也寫一份)。值 0=顯示,1=隱藏。 腳本內保留 5 個內建 CLSID 對照表註解,未來要新增/移除其他圖示 (使用者檔案 / 網路 / 資源回收筒)只需動 $showOnDesktop 陣列。 --- steps/07-apply-ui-ime-default-profile.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/steps/07-apply-ui-ime-default-profile.ps1 b/steps/07-apply-ui-ime-default-profile.ps1 index 7bbdc08..d2178cb 100644 --- a/steps/07-apply-ui-ime-default-profile.ps1 +++ b/steps/07-apply-ui-ime-default-profile.ps1 @@ -49,6 +49,26 @@ function Apply-UiImeSettings { Set-RegValue $tg 'Hotkey' '3' 'String' Set-RegValue $tg 'Language Hotkey' '3' 'String' Set-RegValue $tg 'Layout Hotkey' '3' 'String' + + # 桌面圖示顯示控制(HideDesktopIcons:0=顯示,1=隱藏; + # NewStartPanel 是 Win11 用的 key,ClassicStartMenu 是舊版相容) + # 內建可控的 5 個 CLSID: + # 1 本機 This PC {20D04FE0-3AEA-1069-A2D8-08002B30309D} + # 2 使用者檔案 User's Files {59031A47-3F72-44A7-89C5-5595FE6B30EE} + # 3 網路 Network {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} + # 4 資源回收筒 Recycle Bin {645FF040-5081-101B-9F08-00AA002F954E} + # 5 控制台 Control Panel {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} + # 目前需求:顯示「本機」與「控制台」(資源回收筒 Win11 預設就有) + $showOnDesktop = @( + '{20D04FE0-3AEA-1069-A2D8-08002B30309D}', # This PC + '{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}' # Control Panel + ) + foreach ($keyName in @('NewStartPanel','ClassicStartMenu')) { + $hk = "$base\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\$keyName" + foreach ($clsid in $showOnDesktop) { + Set-RegValue $hk $clsid 0 + } + } } Section 'apply-ui-ime-default-profile' {