Execute the following command to confirm that the packages have been installed to the WINPE image:
dism /image:c:\Winpe /get-packages
Execute the following command to commit the changes made to the WINPE image:
imagex /unmount c:\Winpe /commit
The file C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim is updated
If you have created the boot image, run the Boot Image Update wizard in the DSM explorer to update the WinPE boot image for use in OSIM. If you have not created the boot image, run the New Boot Image wizard. If you have created the boot image, run the Boot Image Update wizard in the DSM explorer to update the WinPE boot image for use in OSIM. If you have not created the boot image, run the New Boot Image wizard.
Add Scripts and Supporting Files to the WinPE Image
After the update to the WinPE image to support VB scripting is complete, add the scripts and supporting files to the image. Follow these steps:
Download the 5 attached files : DiskPercent.vbs, Diskpart_template_legacy.txt, Diskpart_template_uefi.txt, Movecd.txt and DelandCreate.txt
DiskPercent.vbs splits the disk 0 in 2 partitions (letter C and D) with a size of 50% each. If another repartition is needed, line 45 could be changed :
Example for 60% on C and 40% on D : DISKUSE=60
Copy these 5 files to the following location: C:\Program Files (x86)\CA\DSM\osimips\os-template\updates\winpe10x64\amd64\ca-osim
Update the OSIMRUN.CMD file, which is the script that is invoked when WinPE is booted. This script is located in the same folder as the copied files in step 2.
by this part (2 lines put in comment and 1 added line) :
:UseWinPEPartition REM x:\amd64\ca-osim\sdmpcimg -m TFTP -t #MPCPATH#/camenu/%$WinPEPartition$% REM diskpart /s %$WinPEPartition$% cscript.exe x:\amd64\ca-osim\DiskPercent.vbs %$WinPEPartition$% if %ERRORLEVEL% NEQ 0 ( diskpart /s x:\amd64\ca-osim\osimdisk_remove_letterC.txt diskpart /s %$WinPEPartition$% )
Save the file
Create your WinPE boot image. If you have created a WinPE boot image and registered the image in CA Client Automation, run the Update Boot Image wizard in DSM Explorer to update with the customizations.
In OSIM job, select a WinPEPartition value :
Use special partition file WIN11.wp1 for Legacy BIOS from CAMENU or Use special partition file WIN11.wp2 for UEFI from CAMENU
Diskpart_template_legacy.txt template file is used for Legacy BIOS option Diskpart_template_uefi.txt template file is used for UEFI option