Run A Custom Script During WIN PE Intialization
You can run a custom script during the WINPE Initialization. To do so, please follow the steps outlined below:
- Download and install WAIK from MS:
- Go to Start > type "WIN PE Tools Command Prompt"
- Execute the following commands:
- Copype.cmd x86 C:\Winpe_x86
- Mount the Windows PE Image using the ImageX command:
- ImageX /MountRW C:\Winpe_x86\Winpe.WIM 1 C:\Winpe_X86\Mount
- Go to C:\Winpe_x86\Mount\Windows\System32\
- Edit the StartNet.CMD. Note: By default, this file ships with the WINPE.WIM Image. Put the commands or another script you want to run when the WINPE enters into Initialization mode.
- Finally, unmount the Image with changes you made using the ImageX command:
- ImageX /UnMount C:\Winpe_x86\Mount /Commit
- Copy the changed WINPE.WIM file to the ISO directory by executing the following command:
- Copy C:\Winpe_x86\Winpe.WIM C:\Winpe_x86\ISO\Sources\BOOT.WIM
That's it! C:\Winpe_x86\ISO\Sources\BOOT.WIM is the changed WIN PE Image.