How to include a Custom Script in a Windows PE Image

You can launch a customized shell application by using a file called Winpeshl.ini. Winpeshl.exe will process the settings in Winpeshl.ini during boot. If you create a customized Winpeshl.ini and require Plug and Play or network support, you must include a call to Wipeinit.exe. Wpeinit.exe specifically installs Plug and Play devices, processes Unattend.xml settings, and loads network resources.

  • Create a customized Windows PE image, use the following steps.
  • Create a text file called Winpeshl.ini by using a text editor (such as Notepad) with the following structure. For example,

AppPath = %SYSTEMDRIVE%\myshell.exe
%SYSTEMDRIVE%\mydir\application1.exe, -option1 -option2
application2.exe, -option1 -option2

  • Set the AppPath entry to the path to your shell application. The path can either be fully qualified or use environment variables, such as %SYSTEMROOT%\System32\Myshell.exe. The AppPath entry does not support command-line options.
  • Save the file to %SYSTEMROOT%\System32 of your customized Windows PE image.
  • Recapture your Windows PE image .

More Details

How to add a Device Driver to an Offline Windows PE Image

To add a device driver to an offline Windows PE image
Apply the base image (Winpe.wim) by using ImageX to a local Windows PE directory. For example:
imagex /apply WinPE.wim 1 c:\winpe_x86\mount\
imagex /mountrw WinPE.wim 1 c:\winpe_x86\mount\
Add the .inf file to the base image by using the peimg /inf command. For example:
peimg /inf= c:\winpe_x86\mount\Windows
where is the location of the .inf file.
Repeat steps 1 and 2 for each additional device driver.
When you finish customizing the image, prepare the image for deployment by using the peimg /prep command.
More details