単一の WIM ファイルを使用した Windows イメージのキャプチャと適用

Windows イメージ (.WIM) ファイルをキャプチャして、新しいデバイスに Windows を展開するために使用します。

Windows ディストリビューション ISO の install.wim ファイルから作業を開始するか、実行中の Windows イメージを .WIM ファイルに一般化してキャプチャすることができます。

WIM ファイルにキャプチャできるのは、1 つのパーティションのみです。 通常は、Windows パーティションだけをキャプチャした後、そのイメージのファイルを使ってドライブ上の残りのパーティションをセットアップすることができます。 カスタム パーティション構成を作成している場合は、「Windows、システム、復旧パーティションのキャプチャと適用」を参照してください。

Diagram showing a new computer with an empty hard drive, plus a single .wim image file, expands to become multiple configured partitions

イメージのキャプチャ

  1. Windows を起動した場合は、他のデバイスに展開できるようイメージを一般化します。 詳細については、「Windows インストールの Sysprep (一般化)」をご覧ください。

  2. Windows PE を使用してデバイスを起動します。

  3. 省略可能 イメージを最適化し、イメージ適用後のデバイスの起動にかかる時間を短縮します。 イメージの最適化は、見込み生産 (BTS) のシナリオなど、多くのマシンに展開するイメージを構築する場合に特に役立ちます。

    DISM /image:C:\ /optimize-image /boot
    
  4. Windows パーティションをキャプチャします。 次に例を示します。

    Dism /Capture-Image /ImageFile:"D:\Images\Fabrikam.wim" /CaptureDir:C:\ /Name:Fabrikam
    

    D: は USB フラッシュ ドライブまたは他のファイル ストレージの場所です。

画像を適用する

  1. Windows PE を使用してデバイスを起動します。

  2. ハード ドライブをワイプしてから、スクリプトを使用して新しいハード ディスク パーティションを設定します。 CreatePartitions-UEFI.txt (古い、従来の BIOS デバイスの場合は CreatePartitions-BIOS.txt) を使用します。

    diskpart /s CreatePartitions-UEFI.txt
    
  3. スクリプトを使用してイメージを適用します。

    D:\ApplyImage.bat D:\Images\Fabrikam.wim
    

サンプル スクリプト

以下は、手順 2 のハードディスク パーティション分割スクリプトのいずれかを使用してパーティション分割されたディスクにイメージを適用する簡単なスクリプトの例です。

rem == ApplyImage.bat ==

rem == These commands deploy a specified Windows
rem    image file to the Windows partition, and configure
rem    the system partition.

rem    Usage:   ApplyImage WimFileName 
rem    Example: ApplyImage E:\Images\ThinImage.wim ==

rem == Set high-performance power scheme to speed deployment ==
call powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

rem == Apply the image to the Windows partition ==
dism /Apply-Image /ImageFile:%1 /Index:1 /ApplyDir:W:\

rem == Copy boot files to the System partition ==
W:\Windows\System32\bcdboot W:\Windows /s S:

:rem == Copy the Windows RE image to the
:rem    Windows RE Tools partition ==
md R:\Recovery\WindowsRE
xcopy /h W:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\

:rem == Register the location of the recovery tools ==
W:\Windows\System32\Reagentc /Setreimage /Path R:\Recovery\WindowsRE /Target W:\Windows

:rem == Verify the configuration status of the images. ==
W:\Windows\System32\Reagentc /Info /Target W:\Windows

Full Flash Update (FFU) を使用して Windows を展開する

Windows、システム、復旧パーティションのキャプチャと適用

UEFI/GPT ベースのハード ドライブ パーティションを構成する

BIOS/MBR ベースのハード ドライブ パーティションを構成する

BCDboot コマンドライン オプション

REAgentC コマンド ライン オプション