I have a USB stick (just upgraded to a 4Gb version) that I carry with me – it is a Windows PE boot disk with a Windows Vista Image on it (amongst other useful bits and pieces). Why? so that I can quickly and easily demonstrate the deployability of Windows Vista – yes I know.. I need to get out more!
I realised the other day that I had not actually gone through the steps to create a Windows PE USB boot disk – so here it is! (the same idea goes for creating a bootable image full stop – ie creating a bootable DVD, prescription PXE boot file, cialis etc)
Before you begin you need the ingredients:
Windows Automated Install Toolkit (WAIK)
A USB stick (depending on what else you want on it will depend on the size that you need – minimum of 512Mb – if you want a Windows Vista image on it then go for a minimum of 2Gb)
- Install the WAIK (it is delivered as an .IMG file from the download site – either burn this to a CD or mount it using a tool such as VirtualClone CD)
- In the Start menu – navigate to All Programs/Microsoft Windows AIK and run the Windows PE Tools command prompt as an Administrator
- At the command prompt – create a temp directory – such as MD c: emp then run set temp=c: emp and set tmp=c: emp
copype x86 c:PEBuild(this copies the PE Source to a new directory that we will use for constructing our image- if you needed the AMD64 source then replace x86 with amd64)
- At the command prompt (notice you are now in the c:PEBuild directory) run
imagex /mountrw winpe.wim 1 mount(this mounts the WinPE image file in the mount directory ready for us to add into)
- So that we have the imagex and deployment tools available in our PE Boot disk, pharm run
xcopy “c:Program FilesWindows AIKToolsx86*.*” mount /s
- At this point you could add other files into the image (such as Ghost tools, PMenu, etc) by copying them into the mount directory – you can also use the peimg command at this point to install other support tools such as scripting and HTA support – run
peimg /list mountto see the full list and then
peimg /installto install new support
- Once you are ready to seal the image up then run
peimg /prep mount– this will ensure that the WinPE image is optimised – you will need to agree to seal it
- After sealing the image you then need to unmount it –
imagex /unmount mount /commit
- To place the newly created custom WinPE image into the correct folder that we can then call on to create the boot disk – run
copy /y winpe.wim isosourcesoot.wim
- To create a bootable ISO file that can then be used to boot into WinPE, change back to c:Program FilesWindows AIKToolsPETools and then run the following command
oscdimg.exe -n -b"c:Program FilesWindows AIKToolsPEToolsx86ootetfsboot.com" c:PEbuildiso c:PEBuildPE.iso
So – you now have an ISO file that you could burn to a CD or DVD but the idea of doing all this was to get a bootable USB device.. so here is the final step.. grab the USB disk – and then use the following diskpart commands (be warned – check the disk that you are going to be using is disk 1 or if not then use the correct one for your circumstance – the clean command is a clean of the disk IT WILL DESTROY THE DATA ON THE DISK THAT YOU SELECT CHECK BEFORE PROCEDING!):
select disk 1
create partition primary size=
select partition 1
After completing the disk clean and creating the format – then copy the contents of c:PEBuildISO directory to the USB Stick.
If you are wanting to be able to do local deployments – then the final step is to add in the WIM file that you want to use (Vista, XP, 2003 etc).
You are now ready to boot off your USB stick and capture or install WIM files!