You can use exit points for the Image Preparation Wizard as needed. For example, you may use them to clean up a device before performing a capture.
Note: Image Capture exit points are only supported for ImageX and Windows Setup capture types.
To use the exit points
PRE.CMD
and POST.CMD
. OSM\PREPWIZ\payload\default\pre
and OSM\PREPWIZ\payload\default\post
respectively.The Image Preparation Wizard copies these files to %temp%\prepwiz\pre
and %temp%\prepwiz\post
on the reference device and removes them before the capture begins. PRE.CMD
is executed before the Image Preparation Wizard starts SysPrep to seal the image. POST.CMD
is executed after Sysprep has sealed the image.
A non-zero return value from either PRE.CMD
or POST.CMD
will cause the Image Preparation Wizard to halt. In interactive mode, you can decide to Stop or Ignore the error and continue. In batch mode, the Image Preparation Wizard will halt.