注意
1.建置前需要準備 Windows 7 x64 安裝光碟與 USB 隨身碟
2.使用 Windows 7 x64建置完成的 USB 隨身碟不支援 32 位元程式,如果需要執行 32 位元程式,需使用 Windows 7 32位元安裝光碟進行建置。
執行 diskpart
SETP 1. 使用管理者權限開啟命令提示字元。
SETP 2. 輸入 diskpart 指令。
清空 USB 隨身碟 (隨身碟為磁碟 2 7400MB)
SETP 1. 輸入 list disk 查看磁碟
SETP 2. 輸入 select disk 2 選擇磁碟 2
SETP 3. 輸入 clean 清除隨身碟
建立 partition 與 format
SETP 1. 輸入 create partition primary 建立
SETP 2. 輸入 format fs=fat32 quick 將隨身碟 format 為 fat32 格式
設定 Partition ative
SETP 1. 輸入 select partition 1 選擇分割區 1
SETP 2. 輸入 active 設定該分割區為 active
設定 USB Boot
SETP 1. 輸入 exit 離開 diskpart,之後將Windows 7 光碟放進光碟機 。
(目前本機中的光碟機位於 D 槽)
SETP 2. 輸入 D: 跳到光碟機。
SETP 3. 輸入cd boot 進入到 boot 目錄。
SETP 4. 輸入 bootsect /nt60 e: 建立開機程式到 E 槽中。
SETP 5. 輸入 xcopy d:\boot /s /e /f e:\boot後輸入 D
( 將 boot 目錄 copy 到隨身碟 )
SETP 6. 輸入 xcopy d:\efi /s /e /f e:\efi後輸入 D
( 將 efi 目錄 copy 到隨身碟 )
SETP 7. 輸入 copy bootmgr* e:\
( 將 bootmgr 與 bootmgr.efi 兩個檔案 copy 到隨身碟 )
擷取 WinRE.wim
SETP 1. 輸入 mkdir c:\test在 C 槽中建立 test 目錄
SETP 2. 輸入 copy d:\sources\install.wim c:\ 將Windows 安裝光碟中的 Install.wim 檔案 copy 到 c槽
SETP 3. 輸入 dism /mount-wim /wimfile:c:\install.wim /index:1 /mountdir:c:\test 將 install.wim mount 到 c:\test 目錄
SETP 4. 輸入 copy c:\test\Windows\System32\Recovery\winRE.wim e:\ 將 Winre.wim Copy 到隨身碟
SETP 5. 輸入 xcopy c:\test\Windows\Boot\EFI\bootmgfw.efi e:\efi\boot\bootx64.efi 後輸入 F
(將 bootmgfw.efi 檔案 copy 到隨身碟中的 /efi/boot/bootx64.efi)
SETP 6. 輸入 dism /unmount-wim /mountdir:c:\test /discard 將 install.wim 檔案 unmount
設定 BCD
(Legacy Boot)
SETP 1. 開啟 Bootice 程式,選擇 BCD 編輯頁籤 -> 其他BCD檔案 -> 選擇 e:\boot\bcd後點選高級編輯模式。
可到以下網址下載
https://sites.google.com/site/gbrtools/home/software/bootice-portable/bootice-downloads
SETP 2. 修改 ApplicationDevice 與 OSDevice 中的 boot wim 檔案
(UEFI Boot)
SETP 1. 開啟 Bootice 程式,選擇 BCD 編輯頁籤 -> 其他BCD檔案 -> 選擇 e:\efi\microsoft\boot\bcd後點選高級編輯模式。
SETP 2. 修改 ApplicationDevice 與 OSDevice 中的 boot wim 檔案
USB 隨身碟開機
之後使用 USB 隨身碟開機,就可以進入 Winre
USB 隨身碟開機後自動啟動命令提示字元
Winre 開機後會檢查 Windows 版本,來決定是否進入 Winre 系統,這裡將把這個檢測動作關閉,並自動開啟命令提示字元。
SETP 1. 輸入 dism /mount-wim /wimfile:e:\winre.wim /index:1 /mountdir:c:\test 將 winre.wim mount 到 c:\test 目錄
SETP 2. 輸入 attrib –r c:\test\Windows\System32\winpeshl.ini
取消檔案唯讀
SETP 3. 輸入 notepad c:\test\Windows\System32\winpeshl.ini
SETP 4. 將下方 AppPath 路徑改為 cmd.exe 路徑
[LaunchApp] AppPath=X:\sources\recovery\recenv.exe |
更改後
[LaunchApp] AppPath=X:\Windows\System32\cmd.exe |
SETP 5. 輸入 dism /unmount-wim /mountdir:c:\test /commit 將 winre.wim 檔案 unmount
USB 隨身碟開機後畫面
參考資料:
https://www.thomas-krenn.com/en/wiki/Creating_Windows_UEFI_Boot-Stick_in_Windows
https://technet.microsoft.com/zh-tw/library/cc766156(v=ws.10).aspx
留言列表