次の方法で共有


.WIM ファイルを使用して Windows イメージをキャプチャして適用します。

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

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

WIM ファイルは、1 つのパーティションのみをキャプチャします。 通常は、Windows パーティションのみをキャプチャし、そのイメージのファイルを使用してドライブ上の残りのパーティションを設定できます。 カスタム パーティション構成を作成した場合は、「Windows、 システム、および回復パーティションのキャプチャと適用」を参照してください。

空のハード ドライブと 1 つの .wim イメージ ファイルを持つ新しいコンピューターを示す図は、複数の構成済みパーティションに拡張されます

イメージをキャプチャする

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

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

  3. 随意 イメージを最適化して、イメージを適用した後にデバイスの起動にかかる時間を短縮します。 イメージの最適化は、ビルドからストックのシナリオのように、多くのマシンにデプロイするイメージを構築する場合に特に役立ちます。

    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 のハード ディスクパーティション分割スクリプトのいずれかを使用してパーティション分割されたディスクにイメージを適用する簡単なサンプル スクリプトです。

Note

Windows UEFI 2023 CA でブートを構成するには、以下のサンプル スクリプトで bcdboot コマンドで /bootex オプションを使用できます。

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 ==
rem == Note: specify /bootex parameter to use Windows UEFI 2023 CA
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

フル フラッシュ 更新プログラム (FFU) を使用して Windows を展開する

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

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

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

BCDboot Command-Line オプション

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