WinPE:マウントとカスタマイズWinPE: Mount and Customize
WinPE は .wim ファイルとして出荷されます。WinPE ships as a .wim file. WinPE イメージのマウントとカスタマイズは、他のすべての Windows イメージと同じプロセスです。Mounting and customizing a WinPE image is the same process as any other Windows image. WinPE には固有のカスタマイズもいくつか含まれています。WinPE also has some customizations that are specific to it. このトピックでは、WinPE イメージをカスタマイズするための一般的な方法について説明します。This topic covers the common ways to customize a WinPE image.
一般的なカスタマイズ:Common customizations:
- デバイス ドライバー (.inf ファイル)。Device drivers (.inf files). ネットワーク カードや記憶装置をサポートするドライバーなどのデバイス ドライバーをカスタマイズできます。You can customize device drivers, such as drivers that support network cards or storage devices.
- パッケージ (.cab ファイル、WinPE オプション コンポーネントとも呼ばれます) 言語、修正プログラム、または PowerShell や HTML Application Language (HTA) などの機能のサポートを追加します。Packages (.cab files, also known as WinPE optional components) Add languages, hotfixes, or support for features like PowerShell and the HTML Application Language (HTA).
- 言語。Languages. 複数の言語で WinPE を実行するには、これらの言語用のパッケージ (オプション コンポーネント) を追加します。To run WinPE in multiple languages, add the packages (optional components) for those languages.
- ファイルとフォルダーを追加します。Add files and folders. これらは WinPE イメージに直接追加できます。These can be added directly to the WinPE image.
- DISM: 新しいバージョンを使用します。DISM: Use a newer version. 新しいバージョンの Windows に最新バージョンの DISM の機能が必要な場合は、DISM を WinPE に直接追加できます。When new versions of Windows require features from the latest version of DISM, you can add DISM directly into WinPE.
- スタートアップ スクリプト。Startup scripts. 例として、ネットワーク接続の設定や、診断ソフトウェアなどのカスタム アプリケーションの追加があります。Examples include setting up a network connection, or adding a custom application, such as diagnostic software.
- アプリ。Apps. WinPE ではレガシ アプリのみがサポートされることに注意してください。Note, WinPE only supports legacy apps.
- 一時ストレージ (スクラッチ領域)。Temporary storage (scratch space). アプリケーションに一時ファイル ストレージが必要な場合は、RAM 内に追加のメモリ領域を予約できます。If your application requires temporary file storage, you can reserve extra memory space in RAM.
- バックグラウンド画像Background image
- 電源スキームPower scheme
- WinPE 設定WinPE settings
- Windows の更新プログラムWindows updates
Windows アセスメント & デプロイメント キットと Windows PE ツールを入手するGet the Windows Assessment and Deployment Kit with Windows PE tools
- Windows アセスメント & デプロイメント キット (Windows ADK) テクニカル リファレンスを Windows プレインストール環境 と共にインストールします。Install the Windows Assessment and Deployment Kit (Windows ADK) Technical Reference, with Windows Preinstallation Environment. Windows 10 バージョン 1809 の ADK を使用している場合は、ADK をインストールした後に、WinPE アドオンをダウンロードしてインストールする必要があります。If you're using the ADK for Windows 10, version 1809, you'll have to download and install the WinPE addon after you install the ADK. 以前のバージョンの ADK では、ADK インストーラーに Windows プレインストール環境 が含まれています。Previous versions of the ADK include Windows Preinstallation Environment in the ADK installer.
32 ビットまたは 64 ビットの一連の Windows PE ファイルを作成するCreate a set of either 32-bit or 64-bit Windows PE files
WinPE をカスタマイズするには、使用する WinPE イメージを用意しておく必要があります。Before you can customize WinPE, you need to have a WinPE image to work with. WinPE イメージを取得する必要がある場合は、WinPE: 起動可能な USB ドライブの作成に関するページを参照して確認ください。If you need to get a WinPE image, see WinPE: Create USB bootable drive to learn how.
Windows PE ブート イメージをマウントするMount the Windows PE boot image
WinPE イメージをテクニシャン PC 上の一時的な場所にマウントするには、DISM を使用します。Use DISM to mount the WinPE image into a temporary location on your technician PC:
Dism /Mount-Image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /index:1 /MountDir:"C:\WinPE_amd64\mount"
カスタマイズを追加するAdd customizations
デバイス ドライバー (.inf ファイル) を追加するAdd device drivers (.inf files)
WinPE イメージにデバイス ドライバーを追加するには、
DISM /add-driver
を使用します。UseDISM /add-driver
to add a device driver to your WinPE image.Dism /Add-Driver /Image:"C:\WinPE_amd64\mount" /Driver:"C:\SampleDriver\driver.inf"
1 つのコマンドを使用してイメージに複数のドライバーを追加できますが、ほとんどの場合、各ドライバー パッケージを個別に追加すると問題のトラブルシューティングが簡単になります。You can add multiple drivers to an image by using one command, but it's often easier to troubleshoot problems if you add each driver package individually.
ドライバーの詳細については、デバイス ドライバー (.inf ファイル) の追加に関するページを参照してください。To learn more about drivers, see Add device drivers (.inf files). 使用可能なすべての DISM ドライバー サービス オプションを確認するには、DISM ドライバー サービスのコマンド ライン オプションに関するページを参照してください。To see all available DISM driver servicing options, see DISM driver servicing command-line options.
パッケージ/言語/オプション コンポーネント/.cab ファイルを追加するAdd packages/languages/optional components/.cab files
WinPE には、追加の機能や言語を有効にするために DISM を使用して追加できるパッケージが含まれています。WinPE has packages that you can add with DISM to enable additional features and languages. イメージにオプション コンポーネントを追加するには、
DISM /add-package
を使用します。UseDISM /add-package
to add optional components to your image. WinPE オプション コンポーネントを追加する場合は、オプション コンポーネントとそれに関連付けられている言語パックの両方を確実に追加するようにしてください。When you add a WinPE optional component, make sure that you add both the optional component and its associated language packs.Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"C:\Program Files\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-HTA.cab" Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"C:\Program Files\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-HTA_en-us.cab"
使用可能なオプション コンポーネントと言語の詳細については、WinPE: パッケージの追加 (オプション コンポーネント リファレンス) に関するページを参照してください。To learn more about available optional components and languages, see WinPE: Add packages (Optional Components Reference).
ファイルとフォルダーを追加するAdd files and folders
ファイルとフォルダーを C:\WinPE_amd64\mount フォルダーにコピーします。Copy files and folders into the C:\WinPE_amd64\mount folder. これらのファイルは、WinPE の X:\ フォルダーに表示されます。These files will show up in the X:\ folder in WinPE.
WinPE の速度が低下し、既定の RAMDisk 環境内の使用可能なメモリがいっぱいになる場合もあるため、ファイルを追加しすぎないようにしてください。Don't add too many files, as these will slow down WinPE and can fill up the available memory in the default RAMDisk environment.
スタートアップ スクリプトを追加するAdd a startup script
カスタマイズされたコマンドを含めるには、Startnet.cmd を変更します。Modify Startnet.cmd to include your customized commands. このファイルは、マウントされたイメージの
C:\WinPE_amd64\mount\Windows\System32\Startnet.cmd
にあります。This file is located in your mounted image atC:\WinPE_amd64\mount\Windows\System32\Startnet.cmd
.このファイルから他のバッチ ファイルまたはコマンド ライン スクリプトを呼び出すこともできます。You can also call other batch files or command line scripts from this file.
プラグ アンド プレイまたはネットワーク サポートが必要な場合は、カスタマイズされた Startnet.cmd スクリプトに wpeinit への呼び出しを含めるようにしてください。For Plug and Play or networking support, make sure that you include a call to wpeinit in your customized Startnet.cmd script. 詳細については、Wpeinit および Startnet.cmd: WinPE スタートアップ スクリプトの使用に関するページを参照してください。For more info, see Wpeinit and Startnet.cmd: Using WinPE Startup Scripts.
アプリを追加するAdd an app
マウントされた WinPE イメージ内にアプリ ディレクトリを作成します。Create an app directory inside the mounted WinPE image.
md "C:\WinPE_amd64\mount\windows\<MyApp>"
必要なアプリ ファイルをローカル WinPE ディレクトリにコピーします。Copy the necessary app files to the local WinPE directory.
Xcopy C:\<MyApp> "C:\WinPE_amd64\mount\windows\<MyApp>"
後で WinPE を起動し、X: ディレクトリからアプリケーションを実行することによりアプリをテストします。Test the app later by booting WinPE and running the application from the X: directory.
X:\Windows\System32> X:\Windows\<MyApp>
アプリに一時ストレージが必要な場合や、WinPE がアプリの実行中に応答しなくなる場合は、WinPE に割り当てられた一時ストレージ (スクラッチ領域) の量の増加が必要になることがあります。If your app requires temporary storage, or if WinPE becomes unresponsive when it runs an app, you may need to increase the amount of temporary storage (scratch space) allocated to WinPE.
WinPE の起動時に実行されるシェルまたはアプリケーションを自動的に起動するには、そのパスの場所を Winpeshl.ini ファイルに追加します。To automatically launch a shell or application that runs when WinPE starts, add the path location to the Winpeshl.ini file. 詳細については、Winpeshl.ini リファレンス: WinPE 起動時のアプリの起動に関するページを参照してください。For more info, see Winpeshl.ini Reference: Launching an app when WinPE starts.
一時ストレージ (スクラッチ領域) を追加するAdd temporary storage (scratch space)
WinPE では、WinPE ファイルのほか、アプリケーションで使用できる追加の一時ファイル ストレージ (スクラッチ領域と呼ばれます) をアンパックするために X: ドライブ上のメモリが予約されます。WinPE reserves memory on the X: drive to unpack the WinPE files, plus additional temporary file storage, known as scratch space, that can be used by your applications. これは既定では、RAM が 1 GB を超える PC の場合は 512 MB であり、それ以外の場合の既定値は 32 MB です。By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. 有効な値は、32、64、128、256、または 512 です。Valid values are 32, 64, 128, 256, or 512.
Dism /Set-ScratchSpace:256 /Image:"C:\WinPE_amd64\mount"
バックグラウンド画像を置き換えるReplace the background image
WinPE の複数のバージョンを取得している場合は、どのバージョンの WinPE が実行されているかがすぐにわかるようにバックグラウンド画像を設定できます。If you've got multiple versions of WinPE, you can set the background image so you can instantly tell which version of WinPE is running.
WinPE のバックグラウンド画像ファイル (\windows\system32\winpe.jpg
) のセキュリティ アクセス許可を変更します。Change the security permissions of the WinPE background image file (\windows\system32\winpe.jpg
). これにより、このファイルを変更または削除できるようになります。This allows you to modify or delete the file.
Windows エクスプローラーで、
C:\WinPE_amd64\mount\windows\system32
に移動します。In Windows Explorer, navigate toC:\WinPE_amd64\mount\windows\system32
.C:\WinPE_amd64\mount\windows\system32\winpe.jpg
ファイルを右クリックし、 [プロパティ] > [セキュリティ] タブ > [詳細] の順に選択します。Right-click theC:\WinPE_amd64\mount\windows\system32\winpe.jpg
file, and select Properties > Security tab > Advanced.[所有者] の横にある [変更] を選択します。Next to Owner, select Change. 所有者を [管理者] に変更します。Change the owner to Administrators.
変更を適用し、[プロパティ] ウィンドウを終了して変更を保存します。Apply the changes, and exit the Properties window to save changes.
C:\WinPE_amd64\mount\windows\system32\winpe.jpg
ファイルを右クリックし、 [プロパティ] > [セキュリティ] タブ > [詳細] の順に選択します。Right-click theC:\WinPE_amd64\mount\windows\system32\winpe.jpg
file, and select Properties > Security tab > Advanced.[管理者] のアクセス許可を、フル アクセスを許可するように変更します。Modify the permissions for Administrators to allow full access.
変更を適用し、[プロパティ] ウィンドウを終了して変更を保存します。Apply the changes, and exit the Properties window to save changes.
winpe.jpg
ファイルを独自の画像ファイルに置き換えます。Replace thewinpe.jpg
file with your own image file.
電源スキームを高パフォーマンスに設定するSet the power scheme to high performance
注: 高パフォーマンスの電源スキームを使用すると、デバイスが通常より高温で動作する場合があります。Note: Using the high performance power scheme can make the device run hotter than usual.
メモ帳で、ファイル
C:\WinPE_amd64\mount\windows\system32\startnet.cmd
を編集して、電源スキームを高パフォーマンスに設定するコマンドを追加します。In Notepad, edit the file:C:\WinPE_amd64\mount\windows\system32\startnet.cmd
, adding a command to set the power scheme to High Performance.wpeinit powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
応答ファイルの設定を追加するAdd answer file settings
- 一部の WinPE 設定 (ファイアウォール、ネットワーク、ディスプレイなどの設定) は、応答ファイルを使用して管理できます。Some WinPE settings can be managed by using an answer file, such as firewall, network, and display settings. これらの設定を処理するには、応答ファイルを作成し、それに unattend.xml という名前を付けて WinPE メディアのルートに追加します。Create an answer file, name it unattend.xml, and add it to the root of the WinPE media to process these settings. 詳細については、Wpeinit および Startnet.cmd: WinPE スタートアップ スクリプトの使用に関するページを参照してください。For more information, see Wpeinit and Startnet.cmd: Using WinPE Startup Scripts.
WinPE に更新プログラムを追加する (必要な場合)Add updates to WinPE (if needed)
WinPE イメージには更新プログラムを適用できますが、これは特定の状況にのみ必要になるものです。You can apply updates to your WinPE image, but you'll only need to for certain situations.
WinPE イメージに更新プログラムを適用するよう指示されている場合は、まず Microsoft Update カタログから WinPE バージョンの最新の更新プログラムをダウンロードする必要があります。If you've been instructed to apply an update to your WinPE image, you'll have to first download the latest update for your WinPE version from the Microsoft update catalog. WinPE の更新プログラムは、一致するバージョンの Windows 10 の更新プログラムに含まれています。Updates for WinPE are included in updates for the matching version of Windows 10. Windows 10 の最新の使用可能な更新プログラムに関する情報は、Windows 10 の更新履歴で見つけることができます。You can find information about the latest available updates for Windows 10 at Windows 10 update history.
最新の更新プログラムをダウンロードします。Download the latest update.
更新プログラムをマウントされた WinPE イメージに適用します。Apply the update to your mounted WinPE image.
Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"E:\windows10.0-kbxxxxx.msu"
ここで、Windows10.0-kbxxxxx.msu は更新プログラム ファイルの名前です。Where Windows10.0-kbxxxxx.msu is the name of the update file
更新プログラムを確定します。Lock in the update:
dism /cleanup-image /image:C:\WinPE_amd64\mount\windows /startcomponentcleanup /resetbase /scratchdir:C:\temp
Windows PE イメージのマウントを解除し、メディアを作成するUnmount the Windows PE image and create media
WinPE イメージのマウントを解除し、変更をコミットします。Unmount the WinPE image, committing changes.
Dism /Unmount-Image /MountDir:"C:\WinPE_amd64\mount" /commit
起動可能なメディア (USB フラッシュ ドライブなど) を作成します。Create bootable media, such as a USB flash drive.
MakeWinPEMedia /UFD C:\WinPE_amd64 F:
メディアを起動します。Boot the media. WinPE が自動的に起動します。WinPE starts automatically. WinPE ウィンドウが表示された後、wpeinit コマンドが自動的に実行されます。After the WinPE window appears, the wpeinit command runs automatically. この手順が完了するまで数分かかる場合があります。This may take a few minutes. カスタマイズを検証します。Verify your customizations.
トラブルシューティングTroubleshooting
- WinPE が起動しない。WinPE won’t boot? 次のトピックの最後にあるトラブルシューティングのヒントを参照してください。WinPE:起動可能な USB ドライブの作成See the troubleshooting tips at the end of the topic: WinPE: Create USB Bootable drive
- ネットワークへの接続に関するヒントについては、「WinPE ネットワーク ドライバー: ドライバーの初期化と追加」をご覧ください。For tips on connecting to a network, see WinPE Network Drivers: Initializing and adding drivers.
- WinPE イメージがサービス不可になる場合は、イメージをもう一度マウントする前に、イメージのクリーンアップが必要になることがあります。If the WinPE image becomes unserviceable, you may need to clean up the images before you can mount the image again. 詳細については、「Windows イメージの修復」を参照してください。For information, see Repair a Windows Image.
作業ディレクトリを削除するには:To delete a working directory:
場合によっては、マウントされたイメージを回復できなくなることがあります。In some cases, you may not be able to recover the mounted image. DISM では作業ディレクトリが誤って削除されないようになっているため、マウントされたディレクトリを削除するためのアクセス権を取得するには、次の手順を試す必要がある場合があります。DISM protects you from accidentally deleting the working directory, so you may have to try the following steps to get access to delete the mounted directory. 次の各手順を試してください。Try each of the following steps:
イメージの再マウントを試みます。Try remounting the image:
dism /Remount-Image /MountDir:C:\mount
イメージのマウント解除と変更の破棄を試みます。Try unmounting the image, discarding the changes:
dism /Unmount-Image /MountDir:C:\mount /discard
マウントされたイメージに関連付けられているリソースのクリーンアップを試みます。Try cleaning up the resources associated with the mounted image:
dism /Cleanup-Mountpoints
関連トピックRelated topics
WinPE:イメージの最適化と圧縮WinPE: Optimize and shrink the image
WinPE for Windows 10WinPE for Windows 10
WinPE:起動可能な USB ドライブの作成WinPE: Create USB Bootable drive
WinPE:ブート CD、DVD、ISO、VHD の作成」をご覧ください。WinPE: Create a Boot CD, DVD, ISO, or VHD
WinPE:ハード ドライブ (フラット ブートまたは非 RAM) へのインストールWinPE: Install on a Hard Drive (Flat Boot or Non-RAM)
WinPE:UEFI モードまたはレガシ BIOS モードでのブートWinPE: Boot in UEFI or legacy BIOS mode
WinPE:パッケージの追加 (オプション コンポーネント リファレンス)WinPE: Add packages (Optional Components Reference)