. "$PSScriptRoot\_common.ps1" # 把 UI / IME 預設套到 Default profile,新使用者首次登入會繼承 Section 'apply-ui-ime-default-profile' { $hivePath = 'C:\Users\Default\NTUSER.DAT' $mountKey = 'HKU\SetupDefault' reg.exe load $mountKey $hivePath | Out-Null try { $base = "Registry::$mountKey" $adv = "$base\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" Set-RegValue $adv 'HideFileExt' 0 Set-RegValue $adv 'Hidden' 1 Set-RegValue $adv 'TaskbarAl' 0 Set-RegValue $adv 'ShowTaskViewButton' 0 Set-RegValue $adv 'LaunchTo' 1 Set-RegValue $adv 'Start_TrackProgs' 0 $theme = "$base\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" Set-RegValue $theme 'AppsUseLightTheme' 0 Set-RegValue $theme 'SystemUseLightTheme' 0 $search = "$base\Software\Microsoft\Windows\CurrentVersion\Search" Set-RegValue $search 'SearchboxTaskbarMode' 0 # SearchSettings 這個 key 在某些 build 上 reg.exe import/add 會被「存取被拒」 # (Win11Debloat 的 Disable_Search_History.reg 跟 Disable_Search_Highlights.reg 都會撞), # 但 PowerShell 的 .NET API 寫得進去——所以這裡一次處理掉,Win11Debloat config 已把這兩項移除 $searchSettings = "$base\Software\Microsoft\Windows\CurrentVersion\SearchSettings" Set-RegValue $searchSettings 'IsDeviceSearchHistoryEnabled' 0 Set-RegValue $searchSettings 'IsDynamicSearchBoxEnabled' 0 $cloud = "$base\Software\Policies\Microsoft\Windows\CloudContent" Set-RegValue $cloud 'DisableSpotlightCollectionOnDesktop' 1 Set-RegValue $cloud 'DisableWindowsSpotlightFeatures' 1 # 鍵盤排序:英文鍵盤排第一(預設英數),注音排第二 $kbPre = "$base\Keyboard Layout\Preload" Set-RegValue $kbPre '1' '00000409' 'String' Set-RegValue $kbPre '2' '00000404' 'String' # CHT 注音:預設英數模式、關掉雲端候選與預測 $cht = "$base\Software\Microsoft\InputMethod\Settings\CHT" Set-RegValue $cht 'Enable Default Input Mode' 0 Set-RegValue $cht 'Enable Cand Predict' 0 Set-RegValue $cht 'Enable Cloud Cand' 0 Set-RegValue $cht 'Enable Cloud Input' 0 # 把系統 Hotkey 切換鍵停掉(3 = 不指定鍵) $tg = "$base\Keyboard Layout\Toggle" Set-RegValue $tg 'Hotkey' '3' 'String' Set-RegValue $tg 'Language Hotkey' '3' 'String' Set-RegValue $tg 'Layout Hotkey' '3' 'String' } finally { [GC]::Collect() Start-Sleep 1 reg.exe unload $mountKey | Out-Null } }