Getting started with Windows PE

One of the tools you'll need to get to grips with if you are going to support or deploy vista is Windows PE - the pre Installation environment. In order to get a copy to work with, you need to Install the Windows Automated Installation Kit.  This is keeping something of a low profile at the moment. I'll post a link to it when I have one. Kudos to Nathan Mercer who says that you can register for it on connect. I will still post a link to the release version when it breaks cover :-) It is now available here. There are 3 steps to getting a copy of PE you can use.

  1. Copy the Windows PE source files somewhere,
  2. Customize Windows PE 
  3. Put it on a bootable USB key or
    make an ISO and burn that to a CD

Copying the source files. Chose a working directory for Windows PE files, the notes I have suggest C:\WinPE_x86. Open a command prompt, go to the where the AIK is installed, and enter the command:

Copype.cmd x86 C:\WinPE_x86

At this point you can Customize the image in the ISO subfolder of C:\WinPE_X86. I'm going to cover that separately but there are 2 things to know here. Firstly PE boots from a WIM file in the BOOT folder this contains Windows itself so drivers Windows options get added and removed here; once you have your WIM file it goes in the ISO\BOOT folder. Second most programs run under PE, so you can put them in ISO\Anything_you_like  own folders.

The notes I have suggest the command to make the ISO folder into an ISO image is as follows. 
Oscdimg -n –bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso
I've found that this gives an error, the parameters I've found to work are

Oscdimg -n c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso -n -bc:\winpe_x86\etfsboot.com

I.e. it goes  SOURCE_FOLDER, ISO_FILE, Switches. -n allows long filenames , and -b specifies a boot sector.  The tool gives a copyright date of 2000 and says it is for Microsoft internal use only.... Sigh. I don't know why we didn't include a CD burning tool either. Steve recently explained that you can get this in the Windows Server 2003 resource kit.

If you want to make a bootable USB key you use the VISTA DISKPART utility. The commands you use in diskpart are

  • select disk 1 {or the number of your USB key, be careful !}
  • clean  {Like I said, be careful this erases the disk}
  • create partition primary
  • select partition 1
  • active
  • format fs=fat32
  • assign
  • exit

Having done that you copy the ISO folder to the USB key

That's it. Now you have your universal tool for imaging and repairing Vista.

 

Technorati tags: Microsoft, Windows, Vista, Windows PE

Updated (1)  to include the link to the WAIK, and thanks to Jesper, to point out this needs the Vista version of disk part.
Updated (2) Active and format had merged into one step above. Thanks Alun.
Updated (3) The download link moved.