Featured Resource:

line

Newsletter

Email Address:


line

Ask the Expert

Have a question for our resident expert? Email your questions to Bob or post in the Forum.

« Cracking Vista and the Microsoft Response | Main | Installing Drivers to a File Based Image (WIM) »

Working with Windows PE Images

Okay, so you got that Windows AIK—now what? Well this baby includes Windows PE which is a DOS replacement for automating the deployment of Windows. This was previously available only to those with Software Assurance or an Enterprise License agreement with Microsoft. Now anyone can get it and here we’ll cover how to customize the Windows PE image to include your own scripts and command line tools...

Begin by running the “Windows PE Tools Command Prompt” shortcut installed by the AIK which update the path of the current command prompt session to include folders where the peimg, oscdimg and imagex utilities reside. Run the copype.cmd script to generate the files and folders needed to build your own Windows PE image. It requires two arguments, the architecture to be used (x86 or amd64) and the destination where you’ll want to work with the files…

copype.cmd x86 c:\images\winpe

Before you can make changes, you’ll need to “mount” the default image provided. This means decompressing the contents of the winpe.wim file (the file based image file). You can then make changes before finally committing the changes to the image (un-mounting it). To do this, you’ll use the imagex tool. Specify the /mountrw switch to mount it for read and write changes, specify the image file to be mounted, specify the number of the image within the image file (in this case 1) and the target location (the mount directory)…

imagex /mountrw c:\images\winpe\winpe.wim 1 c:\images\winpe\mount

At this point you can go into the c:\images\winpe\mount folder structure and add any new files you wish to include in your Windows PE image. You can add scripts, command line tools, whatever you need. Other customizations are possible and I’ll go into more such changes in the future. Also, there is a WinPE.CHM file that provides some good details on what you can do. When you are done, unmount the image to rebuild the winpe.wim image file as follows…

imagex /unmount c:\images\winpe\mount /commit

At this stage the mount folder is again empty and all files are back in the image file (winpe.wim). Next, let’s make an ISO file out of this image file so we can burn it to a disc or what I like to do is set it as the source for a VMware virtual machine. This way I can easily boot into the ISO image and be sure it is working as desired before burning to physical media.

The ISO folder already contains a default “boot.wim” file that you’ll want to replace with the one you have just created. Cope the new one over the default like so…

copy c:\images\winpe\winpe.wim c:\images\winpe\iso\sources\boot.wim

This done, you can actually create the ISO image using the provided oscdimg tool as follows…

oscdimg –n –bc:\images\winpe\etfsboot.com c:\images\winpe\iso c:\images\winpe\winpe.iso

This command will take a few seconds to run and will provide a percentage complete to show progress as the ISO file is generated.

Comments

In regards to WinPE, is there a way to do a network boot of WinPE on a system that does not have a hard drive? Essentially, I'd like to find a way to load up the image into RAM and boot directly from RAM - no intermediate hard drive or UFD/CDROM media...

Thanks in advance.

You sure can. As long as your computer can be configured to boot to a USB drive, you can boot to a USB pen drive-- or a CD/DVD.

I've just now posted details here on the steps that are necessary.

Although not free, there is a video on doing all of this at AppDeploy.com

Post a comment

(All comments are approved by site leader before appearing here. Thanks for commenting!)

Library Resources

line
line

Bob Kelly's Bio:

Bob Kelly is the founder of AppDeploy.com — a resource focused on desktop management products and practices. He is author of the Start to Finish Guide to Scripting with KiXtart and The Definitive Guide to Windows Desktop Administration. He is also president and co-founder of iTripoli, Inc. who provide AdminScriptEditor.com, home to an integrated suite of scripting tools and a shared library of scripts and language help. Not enough? For more on Bob click here.