2015年7月25日 星期六

Windows to go 使用VHD方法製作

Windows 8之後有提供一個功能,可以將Windows OS放在USB上,可以帶著走的功能,以下借來介紹如何製作。
Step 1. 以管理者權限,開啟命令提示字元,輸入 "diskpart"。

Step 2.輸入以下命令,在系統中建立一個虛擬磁碟。
::設定虛擬磁碟檔案大小為10GB,且型態為固定
create vdisk file=c:\win8.vhd maximum=10000 type=fixed 
select vdisk file=c:\win8.vhd 
attach vdisk
create partition primary
format fs=ntfs quick
assign letter=V
active
exit

Step 3. 使用ImageX.exe展開Windows 8.1 install.wim檔,到剛才建立的虛擬磁碟檔案中。
cd C:\Program Files\Windows Kits\8.2\Assessment and Deployment Kit\Deployment Tools\x86\DISM
imagex.exe /apply C:\Users\Amin\Desktop\sources\install.wim 1 V:\


Step 4. 將c:\win8.vhd檔案,複製到USB隨身碟上,這需要幾分鐘到幾十分鐘的時間。

Step 5. 對USB設定開機選單,完成Windows to go的製作,接著就可以將USB隨身碟拿到其他電腦上進行開機。
cd C:\Program Files\Windows Kits\8.2\Assessment and Deployment Kit\Deployment Tools\x86\BCDBoot

::/f all為設定 Legacy BOOT 與 UEFI BOOT
bcdboot.exe V:\windows /s D:\ /f all /l en-us

::設定Legacy Boot選單
bcdedit /store D:\boot\bcd /set {default} device vhd=[locate]\win8.vhd
bcdedit /store D:\boot\bcd /set {default} osdevice vhd=[locate]\win8.vhd

::設定UEFI Boot選單
bcdedit /store D:\EFI\Microsoft\Boot\bcd /set {default} device vhd=[locate]\win8.vhd
bcdedit /store D:\EFI\Microsoft\Boot\bcd /set {default} osdevice vhd=[locate]\win8.vhd