執行 sysprep /oobe /generalize /shutdown 重啟後,電腦進入 **特殊化** 階段 → **OOBE** 階段。自動應答檔在這兩階段注入設定,實現無人值守部署。
階段:**specialize**
Microsoft-Windows-Shell-Setup
CopyProfile = true
效果:封裝時將目前登入使用者的完整設定(桌面捷徑、開始功能表、登錄偏好等)複製到 Default 設定檔,新建使用者即繼承。
階段:**specialize**
Microsoft-Windows-Shell-Setup
AutoLogon
Enabled = true
Username = Administrator
Password = 密碼
LogonCount = 3 # 自動登入次數,視需求調整
PlainText = true
參考「Windows 7 步步為營」系列文章。
階段:**oobeSystem**
Microsoft-Windows-Shell-Setup
OOBE
HideEULAPage = true
HideWirelessSetupInOOBE = true
NetworkLocation = Work
ProtectYourPC = 3
SkipMachineOOBE = true
SkipUserOOBE = true
代價: 犧牲 ProfilesDirectory、FirstLogonCommands、LogonCommands 等 OOBE 階段可用設定。
Microsoft-Windows-IE-InternetExplorer
Home_Page = https://intranet.company.com
SearchScopes 預設搜尋引擎
Favorites 內建我的最愛
DisableFirstRunWizard = true
DisableWelcomePage = true
預設 C:\Users 想移至 D:\Users。正常在 oobeSystem → Microsoft-Windows-Shell-Setup → ProfilesDirectory 設定。但跳過 OOBE 後此設定不生效。
嘗試方向:利用「接管 Windows 部署」階段(auditUser/oobeSystem 交界),透過 FirstLogonCommands 執行 reg import 修改註冊表 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList 中的 ProfilesDirectory、`Default`、`Public` 路徑。但時序與權限極難把控,尚未成功驗證。
若有前輩成功經驗請不吝分享!
autounattend.xml。sysprep /unattend:autounattend.xml 指定。封裝核心在於理解階段順序與元件相依性。建議先用 Windows SIM 開啟範例 XML 研讀,再逐項加入需求設定。記錄每次測試結果,建立個人知識庫。