在使用您在创建 WIMBoot 图像中创建的图像的新 Pc 上部署 Windows 图像文件启动 (WIMBoot).
WIMBoot 可以帮助您通过引导至一个 WIM 文件,而不是一套的未压缩的 Windows 文件节省硬盘空间。
若要部署 Windows,您需要使用图像分区末尾的驱动器中,配置的硬盘分区包含 Windows 图像文件,Windows RE 图像文件,和如果包括,图像文件为最后的自定义 (custom.wim)。
下面的关系图显示了此配置。
最后的自定义在 custom.wim 文件中可能包括 Windows 更新、 生成顺序的应用程序和驱动程序或其他通常发生在工厂地板的变化。这意味着你不用到完全加载 install.wim 夺回这些更新。此更改可能可以节省在制造过程中的时间。
如果这个 custom.wim 文件的大小差别很大,您可能需要使用一个脚本来计算图像分区的大小。更多的信息,请参阅部署 WIMBoot 图像: 如果你不知道的预付的图像大小.
![]() |
---|
因为他们不能还原的 WIMBoot 配置的 PC 不预加载传统的系统恢复工具。相反,使用的内置按钮重置工具,您可以在此页上使用的过程自动进行配置。
|
准备一个 WIMBoot 图像 (install_wimboot.wim) 和分离出来的 Windows RE 映像 (winre.wim)。更多的信息,请参阅创建 WIMBoot 图像.
通过将 Windows 8.1 更新包添加到 Windows PE 5.0,然后收拾图像创建一个 Windows PE 5.1 可引导驱动器。更多的信息,请参阅更新 WinPE 5.0 到 WinPE 5.1.
引导参考 PC 到 Windows PE 5.1。
使用以下分区布局的驱动器的格式:
![]() |
---|
如果您计划在 custom.wim 文件中进行更改厂楼,一定要留下足够的空间用于这些增补。但尽量不要添加太多自由的空间,尤其是在设备与有限的驱动器空间,因为该分区的大小无法调整后向它添加了文件。
要变通解决此问题,您可以设置此图像分区以后。更多的信息,请参阅部署 WIMBoot 图像: 如果你不知道的预付的图像大小.
|
Diskpart 脚本示例
该脚本暂时将这些驱动器字母分配: Windows = C 和图像 = M。如果您要将部署到 Pc 与未格式化的硬盘,可能要修改此脚本,以使用一个驱动器号,就在附近的英文字母,例如 W,以避免驱动器字母冲突结束。不要使用 X,因为此驱动器号留给 Windows PE。个人计算机重新启动后,Windows 分区分配盘符 C,和其他的分区不接收驱动器号。我们已经添加到这两个分区的卷的名称,但它们不是必需。
rem == Diskpart /s CreatePartitions-WIMBoot.txt == rem == These commands set up the hard drive partitions rem for WIMBoot. rem rem Adjust the partition sizes to fill the drive rem as necessary. == select disk 0 clean convert gpt rem == 1. System partition (ESP) =================== create partition efi size=100 format quick fs=fat32 label="System" rem == 2. Microsoft Reserved (MSR) partition ======= create partition msr size=128 rem == 3. Windows partition ======================== create partition primary shrink minimum=10000 format quick fs=ntfs label="Windows" assign letter=c rem === 4. Images partition ======================== create partition primary format quick fs=ntfs label="Images" assign letter=m set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" gpt attributes=0x8000000000000001 list volume exit
创建一个称为"Windows 映像"图像分区上的文件夹。此文件夹名称是必需的。
md "M:\Windows Images\"
从 USB 驱动器或网络驱动器 (N) 的 Windows 的图像复制到 Windows 映像的文件夹中。如果有必要到 install.wim 命名的 Windows 映像。
copy N:\Images\install_update1.wim "M:\Windows Images\install.wim"
将 Windows 映像应用到 Windows 分区 (驱动器 C),使用/WIMBoot
选项。
建议: 为创建一个临时暂存文件夹 DISM,避免问题与相关的短文件名。若要防止捕获 DISM 日志在您的图像,请选择您 DISM 排除列表中的位置。更多的信息,请参阅DISM 配置列表和 WimScript.ini 文件.
当您使用DISM /Apply-Image
命令/WIMBoot
选项时, ImageFile
位置和ApplyDir
分区必须在相同的硬盘上。
md C:\Recycler\Scratch DISM /Apply-Image /ImageFile:"M:\Windows Images\install.wim" /ApplyDir:C: /Index:1 /WIMBoot /ScratchDir:C:\Recycler\Scratch
![]() |
---|
使用/WIMBoot 的 Windows 映像应用时,DISM 将指针文件从 Windows 分区添加到图像分区。这些指针文件使 PC 显示和运行 Windows 文件是存储在 Windows 分区上。但他们仍然主要驻留 install.wim 文件内部的图像分区中。应用图像之后,不删除 install.wim 文件。
|
创建启动文件并将它们设置为引导至 Windows 分区。
C:\Windows\System32\bcdboot C:\Windows
Windows RE 文件复制到图片文件夹中。请注意 Winre.wim 可能是隐藏的文件。使用 robocopy 或 xcopy 复制该文件。在此示例中,"回声 f"命令取消的 xcopy"文件或目录"提示:
md M:\Recovery\WindowsRE echo f | xcopy N:\Images\winre.wim M:\Recovery\WindowsRE\winre.wim /h
注册 Windows RE 的分区。
C:\Windows\System32\Reagentc /SetREImage /Path M:\Recovery\WindowsRE /Target C:\Windows
如果您的分区配置不同从上面列出的推荐配置,创建一个 ResetConfig.xml 文件并将其包括在 M:\Windows Images\ 文件夹中,使您的用户创建的裸机恢复介质。更多的信息,请参阅ResetConfig XML 参考.
示例命令行脚本
@echo off echo == ApplyWIMBootImage.cmd == echo == These commands deploy a specified Windows echo image file to the Windows partition, and configure echo the system partition. rem Usage: ApplyWIMBootImage InstallWim WinREWim rem Example: ApplyWIMBootImage N:\Images\Install-WIMBoot.wim N:\Images\WinRE-WIMBoot.wim if "%2" equ "" ( echo == Error: Specify a Windows image and a Windows RE image file. echo Example: ApplyWIMBootImage N:\Images\Install-WIMBoot.wim N:\Images\WinRE-WIMBoot.wim exit /b 0 ) @echo on rem == Add the Windows image to the Images partition == md "M:\Windows Images\" copy %1 "M:\Windows Images\install.wim" rem == Create a scratch directory for DISM operations md "C:\Recycler\Scratch" rem == Apply the Windows image to the Windows partition == dism /Apply-Image /ImageFile:"M:\Windows Images\install.wim" /ApplyDir:C: /Index:1 /WIMBoot /ScratchDir:C:\Recycler\Scratch rem == Create boot files on the System partition == C:\Windows\System32\bcdboot C:\Windows :rem == Add the Windows RE image to the Images partition == md M:\Recovery\WindowsRE copy %2 M:\Recovery\WindowsRE\winre.wim :rem == Register the location of the recovery tools == C:\Windows\System32\Reagentc /SetREImage /Path M:\Recovery\WindowsRE /Target C:\Windows
重新启动 PC 和用户身份登录。
安装并运行在 Windows 环境中的性能测试软件。
进入 Windows PE 5.1 重新启动 PC。
暂时于 Windows 和图像的分区分配驱动器号。
Diskpart /s ResetWIMBootDriveLetters.txt
rem == Diskpart /s ResetWIMBootDriveLetters.txt == select disk 0 select partition 1 assign letter s select partition 3 assign letter c select partition 4 assign letter m list volume exit
对 Windows 分区重新应用的 Windows 映像。建议: 为 DISM 创建一个临时的暂存目录。
rem == ResetWIMBootImage.cmd == format C: /Q /FS:NTFS /v:"Windows" md C:\Recycler\Scratch DISM /Apply-Image /ImageFile:"M:\Windows Images\install.wim" /ApplyDir:C: /Index:1 /WIMBoot /ScratchDir:C:\Recycler\Scratch
在 OOBE 屏幕进入审计模式,请按CTRL+SHIFT+F3 。
添加最后的自定义设置,如生成顺序的应用程序、 驱动程序或 Windows 更新。
编写 PC 到 OOBE 模式,启动和关闭 PC。
建议: 一般化要优化的按钮重置功能的图像。如果您这样做,我们建议您启动电脑一次图像分区创建以加快 OOBE 进程之后。更多的信息,请参阅执行最后重新启动.
C:\Windows\System32\Sysprep\Sysprep /OOBE /shutdown /generalize
进入 Windows PE 5.1 重新启动 PC。
请检查以确保您有足够的空间来捕获所做的更改的图像分区上。如果你能让它这远和那里是没有房间,你可能必须回到此页的开始。
捕获到 custom.wim 工厂车间自定义。
DISM /Capture-CustomImage /CaptureDir:C: /ScratchDir:C:\Recycler\Scratch
![]() |
---|
当你捕获自定义图像时,DISM 捕获 (基于特定 install.wim 文件) 的增量文件更改到新的文件,custom.wim,并转换为指针文件到这些文件。Custom.wim 放在 install.wim 相同的文件夹中。
|
草稿文件夹中删除。
rd C:\Recycler /s /q
通过将它们设置为只读保护 Windows 映像的分区。从提升的命令提示符下运行这些步骤:
icacls "M:\Windows Images" /inheritance:r /T icacls "M:\Windows Images" /grant:r SYSTEM:(R) /T icacls "M:\Windows Images" /grant:r *S-1-5-32-544:(R) /T
![]() |
---|
它是不需要隐藏的 WIMBoot 分区。
|
建议: 如果你的广义图像执行工厂车间自定义时,允许 PC 进行了一次对 Windows 引导以加快最终用户首次启动体验。PC 到达 OOBE 屏幕后,您可以安全地关闭 PC 而无需关闭它。
引导到 Windows PE。
暂时将驱动器号分配给 Windows 和图像的分区,并验证系统、 MSR、 窗口和图像分区存在,以及按规定的顺序。
Diskpart /s VerifyWIMBootPartitions.txt
Rem = Diskpart /s VerifyWIMBootPartitions.txt select disk 0 select partition 3 assign letter C select partition 4 assign letter M list partition exit
预期的输出:
Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 System 100 MB 1024 KB Partition 2 Reserved 128 MB 101 MB Partition 3 Primary (size) GB 229 MB Partition 4 Recovery (size) GB (size) GB
验证图像分区具有这些属性:
diskpart select disk 0 select partition 4 detail partition exit
预期的输出:
Partition 4 Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac Hidden : Yes Required: Yes Attrib : 0X8000000000000001 Offset in Bytes: 48474619904 Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 2 M Images NTFS Partition 74 GB Healthy Hidden
验证这些 WIM 文件中的图像分区:
dir "M:\Windows Images" dir M:\Recovery\WindowsRE
预期的输出:
M:\>dir "M:\Windows Images" Volume in drive M is Images Volume Serial Number is 8AA9-5E31 Directory of M:\Windows Images 12/19/2013 04:16 PM <DIR> . 12/19/2013 04:16 PM <DIR> .. 12/18/2013 02:53 PM 3,541,267,886 install.wim 12/18/2013 03:00 PM 1,000,000 custom.wim 1 File(s) 3,542,267,886 bytes 2 Dir(s) 52,428,800 bytes free M:\>dir M:\Recovery\WindowsRE Volume in drive M is Images Volume Serial Number is 8AA9-5E31 Directory of M:\Recovery\WindowsRE 12/19/2013 04:21 PM <DIR> . 12/19/2013 04:21 PM <DIR> .. 12/14/2013 07:28 AM 228,955,033 winre.wim 1 File(s) 228,955,033 bytes 2 Dir(s) 52,428,800 bytes free
验证 Windows Images 子文件夹具有只读访问权限。
icacls "M:\Windows Images"
预期的输出:
M:\Windows Images BUILTIN\Administrators:(R) NT AUTHORITY\SYSTEM:(R)
验证 Windows RE 正确地设置为有效的恢复映像的位置。
C:\Windows\System32\Reagentc /Info /Target C:\Windows
预期的输出:
Windows RE status: <either Enabled or Disabled> Windows RE location: Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000 Custom boot key scan code: 0x0 Recovery image location: \\?\GLOBALROOT\device\harddisk0\partition4\RecoveryImage Recovery image index: 1 Custom image location: Custom image index: 0
重置按钮重置工具中使用的 PC。
如果按钮恢复过程失败,请确保您已经更新 Windows 和 Windows RE 映像,包括 Windows 8.1 更新。有关更多的信息,请参阅安装 Windows 的 Oem 8.1 更新.