- 分区创建
select volume W
clean
convert mbr
create partition primary size 350
create partition primary
select partition 1
format fs=fat32 quick
active
assign letter=x
select partition 2
format fs=ntfs quick
assign letter=W
attributes volume set nodefaultdriveletter
exit
- 部署wim
Dism /Apply-Image /ImageFile:"I:\sources\install.wim" /ApplyDir:W: /Index:1
- 部署驱动
dism /image:W: /add-driver /driver:".\Drivers" /recurse /ForceUnsigned
- 防止本机磁盘自动联机(保持脱机)
dism /image:W: /Apply-Unattend:".\san_policy.xml"
- 禁用WinRE
copy /b /y ".\unattend.xml" W:\Windows\System32\sysprep\
- 部署mbr+biod和mbr+uefi引导
bcdboot W:\windows /l zh-CN /s X: /f all
bcdedit /store X:\EFI\Microsoft\Boot\BCD /set {bootmgr} device partition=X:
bcdedit /store X:\EFI\Microsoft\Boot\BCD /set {default} device partition=W:
bcdedit /store X:\EFI\Microsoft\Boot\BCD /set {default} osdevice partition=W:
san_policy.xml
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="offlineServicing">
<component
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
language="neutral"
name="Microsoft-Windows-PartitionManager"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
versionScope="nonSxS"
>
<SanPolicy>4</SanPolicy>
</component>
<component
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
language="neutral"
name="Microsoft-Windows-PartitionManager"
processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35"
versionScope="nonSxS"
>
<SanPolicy>4</SanPolicy>
</component>
</settings>
</unattend>
unattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-WinRE-RecoveryAgent"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35" language="neutral"
versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UninstallWindowsRE>true</UninstallWindowsRE>
</component>
<component name="Microsoft-Windows-WinRE-RecoveryAgent"
processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35" language="neutral"
versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UninstallWindowsRE>true</UninstallWindowsRE>
</component>
</settings>
</unattend>
参考:
WinPE: Storage Area Network (SAN) Policy
Deploy Windows To Go in your organization