將 Windows PE (WinPE) 安裝至硬碟隱藏分區,能在系統崩潰、中毒、無法開機時,無需外部 USB 即可進入維護環境備份資料、修復啟動、掃毒、重置密碼。本文詳細記錄分區規劃、格式化、Grub4DOS 引導安裝、WinPE 部署、選單配置的標準化流程。
驗證: Windows「磁碟管理」 (diskmgmt.msc) 中該分區顯示「健康 (隱藏)」,無磁碟機代號,大小正確。
grubinst_gui.exe (管理員)。(hd0) [41863MB])。HIDDEN:\boot\ (BCD, boot.sdi, memtest.exe)HIDDEN:\sources\boot.wim (核心映像)HIDDEN:\bootmgr (UEFI/Legacy 啟動管理程式)HIDDEN:\EFI\Microsoft\Boot\ (UEFI 啟動檔)boot.wim (無 bootmgr/BCD),需手動建立 BCD:bcdedit /createstore HIDDEN:\boot\BCDbcdedit /store HIDDEN:\boot\BCD /create {ramdiskoptions} /d "Ramdisk Options"bcdedit /store HIDDEN:\boot\BCD /set {ramdiskoptions} ramdisksdidevice bootbcdedit /store HIDDEN:\boot\BCD /set {ramdiskoptions} ramdisksdipath \boot\boot.sdibcdedit /store HIDDEN:\boot\BCD /create /d "WinPE Maintenance" /application osloader → 產生 GUID →bcdedit /store HIDDEN:\boot\BCD /set {GUID} device ramdisk=[boot]\sources\boot.wim,{ramdiskoptions}bcdedit /store HIDDEN:\boot\BCD /set {GUID} path \windows\system32\winload.efi (UEFI) 或 winload.exe (Legacy)bcdedit /store HIDDEN:\boot\BCD /set {GUID} osdevice ramdisk=[boot]\sources\boot.wim,{ramdiskoptions}bcdedit /store HIDDEN:\boot\BCD /set {GUID} systemroot \windowsbcdedit /store HIDDEN:\boot\BCD /set {GUID} detecthal yesbcdedit /store HIDDEN:\boot\BCD /set {GUID} winpe yesbcdedit /store HIDDEN:\boot\BCD /displayorder {GUID} /addlast在隱藏分區根目錄建立/編輯 menu.lst:
timeout 3
default 0
gfxmenu /boot/gfxmenu (可選圖形選單)
title Windows PE Maintenance Environment
find --set-root /bootmgr
chainloader /bootmgr
title Windows 7/10/11 Installation (ISO)
find --set-root /ISOs/Win10_x64.iso
map /ISOs/Win10_x64.iso (0xff)
map --hook
chainloader (0xff)
title MemTest86+ Memory Test
find --set-root /boot/memtest.exe
kernel /boot/memtest.exe
title Hard Disk Tools (MHDD, Victoria, HDAT2)
find --set-root /tools/hddtools.img
map --mem /tools/hddtools.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title Reboot
reboot
title Shutdown
halt
sources\boot.wim 為新版 WinPEmenu.lst 新增工具/ISOEFI\Microsoft\Boot\bootmgfw.efi 複製至系統 ESP 分區 (通常 100-500MB FAT32) 對應位置。bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi 註冊。password --md5 $1$xxxx (menu.lst 首行) 防止未授權進入維護模式。硬碟隱藏分區 WinPE 是「隨身維護站」的終極形態:零外部媒體依賴、病毒難感染、開機熱鍵直達、工具鏈完整。遵循「隱藏主分區 + Grub4DOS MBR + BCD/boot.wim + menu.lst」標準化建構,配合 UEFI 相容配置,即可為任何 Windows 電腦配置企業級離線維護能力。建議每季度驗證一次啟動與核心功能,確保關鍵時刻「叫得醒、用得上、救得回」。