Files
windows-unattend/steps
Timmy 22e002d444 07-apply-ui-ime-default-profile:除了 Default profile 也套到所有已載入的真人 user hive
之前只寫 Default profile NTUSER.DAT,新使用者首次登入會繼承——
但若腳本是在 User 已登入後才被重跑(例如 deploy 後想改設定),
Default 改動不會反映到既存的 User profile,肉眼看不到變化。

把套設定的邏輯抽成 Apply-UiImeSettings function,先寫 Default、
再用 Win32_UserProfile 列出所有非系統 profile,凡是 hive 已載入
(HKEY_USERS\<SID> 存在)的就一併寫進去。production 流程下
User 還沒建立、所以只有 Admin 拿到(無關緊要 Admin 會被隱藏);
re-run 時 User hive 已載入則直接生效。
2026-04-28 08:52:29 +08:00
..

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
steps/ — 拆解後的 post-install 步驟,每段一個 .bat 雙擊執行
==========================================================

用法
----
1. 把 USB 插上 Windows 機器
2. 用檔案總管打開 D:\ventoy\script\steps\D 換成 USB 在 Windows 看到的代號)
3. 雙擊任一個 NN-xxx.bat會自動 UAC 提權)
4. 黑色 console 視窗會即時顯示 START / DONE / ERR
5. 跑完按任意鍵關掉視窗

想一次跑完,雙擊 RUN-ALL.bat 即可。

順序建議
--------
Phase 1不需要網路本機設定
  01-firewall-ssh-22                  防火牆開 SSH 22
  02-rdp-enable-3389                  打開 RDP
  03-icmp-echo-allow                  允許 ping
  04-winrm-enable                     啟用 WinRM
  05-onedrive-remove                  移除 OneDrive
  06-cortana-websearch-off            關 Cortana / Web Search
  07-apply-ui-ime-default-profile     UI/IME 預設套到 Default profile
  08-hide-admin-account               把 Admin 從登入畫面藏掉
  09-pause-windows-update             暫停 WU避免下面動作搶頻寬

Phase 2需要網路下載安裝
  10-openssh-server-install           OpenSSH Server FoD
  11-kms-activate                     KMS 啟用
  12-winget-install-chrome            裝 Chrome
  13-remove-windows-ai                RemoveWindowsAI 線上腳本
  14-win11debloat                     Win11Debloat讀同目錄 win11debloat-config.json
  15-remove-uwp-apps                  批次移除 UWP
  16-install-telegram                 裝 Telegram

收尾
  17-resume-trigger-wu                解除 WU 暫停 + 觸發掃描

Log
---
所有 step.ps1 共用同一個 log
  C:\Windows\Temp\setup.log

每段會印 [時間] === 段名 START === / DONE === / ERR ===

檔案結構
--------
  _common.ps1                共用 helperLog / Section / Set-RegValue / Wait-Network
  _template.bat              .bat 樣板(不要動)
  NN-xxx.ps1                 各段邏輯
  NN-xxx.bat                 各段 .bat自動 UAC + 跑 .ps1
  win11debloat-config.json   14 段用的 JSON 設定
  RUN-ALL.bat                依序跑 01..17 全部