Friday, December 12, 2008

How to create a Bootable WinPE 2.0 USB Key

I have to start by saying that I did not create these instructions initially. They came from Windows Connected. However I did add some of my own comments about issues that I found during the process. In the end I ended up with a bootable USB key that boots into WINPE 2.0. The initial interface is just a command prompt, however I added some portable apps that run under winpe. I now have the ability to check any disks for virus, ftp files off to another pc for recovery, as well as a few other utilities.

Below are the steps I followed to get my usb key working.

------------------------------------------------------------------------------------

Windows Preinstallation Environment (PE) 2.0 is a slimed down version of Windows (hence all the MiniNT references) that used to be the exclusive domain of OEM's providers. Microsoft has wisely chosen to offer this to the masses as part of the Windows AIK. USB keys can be found just about anywhere these days for next to nothing. Combine the capabilities of WinPE with the portability of a USB key and you just made a very powerful troubleshooting, imaging, and data recovery tool. Here is a quick step by step on how to do just that:

Step 1. ) Get USB Key ( I am using a 2GB PNY Attache key)

You probably already have a few and if not you can purchase these just about anywhere, so I won't tell you where to get one. You should get a USB 2.0 device of at least 512mb in size, but if you plan on putting a lot into a custom PE install or plan on using it to transfer data too then you are better served getting a larger size (2.0-4.0GB)

Step 2.) Download and Install the Windows Automated Installation Kit (Windows AIK) This is almost 1GB in size so it may take a while.

This deployment oriented tool set contains Windows PE 2.0.

Step 3.) Format the USB key

Note: This must be done from Windows Vista (Although this says it requires Windows Vista I have read that someone has gotten this to work on XP)

Start a command prompt and run the following. This set of commands assumes your USB key is detected as disk 1, you should double check that by doing a list of the disks before cleaning it. If you have multiple hard drives you could end up wiping your second drive using this command. You have been warned.

* Diskpart
* select disk 1
* clean
* list part (to see if the partitions are all gone)
* clean ( I had to run this again for some reason even though it said it completed successfully the first time)
* list part (to see if the partitions are all gone)
* create partition primary
* select partition 1
* active
* format fs=fat32
* assign
* exit

Step 4.) Setup Windows PE

* In this step you will create and customize WinPE for your disk. From the machine that you installed the Windows AIK go to the start menu and select "Windows PE Tools Command Prompt" from under the Windows AIK program folder.
* Copype.cmd x86 c:\winpe_x86
o you can create an 64-bit version by changing the architecture from x86 to amd64
* Add customizations to WinPE
o copy any tools you want available to the C:\winpe_x86\iso folder such as imaging tools if you want to use this for capturing images (imagex, wimscript.ini)

Step 5 .) Copy Windows PE to USB Key

Insert the USB key into the machine that you have WinPE on and run the following command to copy the contents to the USB Key

xcopy c:\winpe_x86\iso\*.* /s /e /f e:\

change c: to reflect the drive your files on and e: to be your USB key.

------------------------------------------------------------------------------------

Once the above completed successfully I tested the usb key on a laptop. It successfully booted into winpe with the command line interface.

I then added some portable apps that I downloaded from portableapps.com and portablefreeware.com

I created a new folder called "Utils" and then copied the apps to the usb key.
I am currently using the following apps on the keys.
*7-Zip - file compression util
*ClamWin Portable - antivirus software
*FileZilla Portable - ftp client to get files off to another pc
*Firefox Portable - Firefox web browser
*Folder2Iso - creates an ISO file to burn to a CD
*Toucan Portable - file sync utility
*WinSCP Portable - secure file transfer utility
*Alt Commander - File Explorer similar to windows explorer for browsing file on disks


If anyone wants to add to this please post your comments.

Hope this helps someone.

No comments: