Friday, August 7, 2009

WES 2009 and WinPE scripting [updated]

Every time you use Windows Embedded Standard, you have to prepare the target hard drive to make it bootable and ready to receive the new generated WES image. In this case I'm using a customized WinPE 2.0 iso to boot the target device (tool retrieve from the Windows Automated Installation KIT or AIK).

Prepare Hard drive scripts :

  • diskpart.script : this script will remove the existing partitions of the drive 0, and create a new one of 800 MB (in my case to leave empty space for the EWF feature)
list disk
select disk 0
clean
create partition primary size=800
select part 1
assign letter=C
format fs=ntfs quick
active
list part
exit
  • prepdisk.bat : this script launch diskpart with the upper script in parameter, followed by bootsec to store the Windows XP boot sector.
@echo off
echo ---------------------------------------------------------
echo !!!!!!!!!!!!!!!!! READ THIS CAREFULLY !!!!!!!!!!!!!!!!!!!
echo.
echo You are ready to erase the content of your hardrive
echo.
echo Do you want to continue - Press Ctrl + C to quit
echo ---------------------------------------------------------
pause
echo ---------------------------------------------------------
echo Are you really sure ?
echo.
echo Continue or Quit now by pressing Ctrl + C
echo ---------------------------------------------------------
pause
diskpart /s .\diskpart.script
bootsect /nt52 c:
echo ---------------------------------------------------------
echo               ==== Disk Ready for WinPE ====
echo ---------------------------------------------------------
- Nicolas

No comments: