Jump to content

How to make a basic WinPE 2.0 CD


Spooky

Recommended Posts

I know a lot of you have probably already done this, so i'm offering some very basic procedures to the un-initiated for creating a very basic WinPE 2.0 CD, sort of a beginners helper kit thing. This uses the same instructions that are available in the WAIK kit. This is for the x86 version, if your using x64 or AMD you will need to read the help .chm's for the information and then make the necessary changes in the attached .bat files.

1. Install the WAIK in either a WinXP or Vista environment. Don't change any of the default install locations or directory names.

2. I've created 8 small .bat files for you to use in this process to keep you from typing all the commands needed and making mistakes. They are attached to this post. I seperated them out into simple basic batch files so you could follow the process along and learn. Feel free to modify them to your hearts content but i'd recommend you use them as is for right now until you get up on the process. I've used some switches in the batch files to supress some prompts so you don't need to make decisions and can watch the process move along. When you have explored the help chm's in the WAIK and feel more comfortable with rolling your own, then make your own batch file changes. Unzip them to C:\Program Files\Windows AIK\Tools\PETools\....or somewhere else and then move them to C:\Program Files\Windows AIK\Tools\PETools\...they have to be in C:\Program Files\Windows AIK\Tools\PETools\

3. After you have put the batch files in C:\Program Files\Windows AIK\Tools\PETools\...go to Start - Programs - Microsoft Windows AIK - and click on 'Windows PE Tools Command Prompt'. The command prompt will open at 'C:\Program Files\Windows AIK\Tools\PETools' with all the necessary environment variables set up for you.

4. Next you need to make sure a directory called 'winPE_x86' DOES NOT ALREADY EXIST in the root of your C:\ drive. If it does you need to either move it somewhere else or delete it. This process assumes the target directory does not already exist and if it does the process will fail.

5. Now back to the 'Windows PE Tools Command Prompt', if everything else above has been done, type "step1.bat" without the quotes. When that step reports back that its done, then type "step2.bat". When that step reports back that its done, then type "step3.bat". Repeat for "step5.bat" ...etc... until you are have finally finished up with running "step8.bat". After each step is completed in the command prompt, you will know its completed when the cursor once again appears on the 'C:\Program Files\Windows AIK\Tools\PETools\' line in the command prompt, dont force it, wait for it. You must run these batch files in order, step1.bat, step2.bat, step3.bat, etc...don't run them out of order.

6. After all the batch files have been run (step1.bat to step8.bat) one at a time use explorer or My Computer to take a look in C:\winpe_x86. You will find an .iso there called 'winpe_x86.iso' almost 187 MB in size. Burn the 'winpe_x86.iso' to a regular CD with your favorite burning application. This iso is bootable, so there is no need to make the CD bootable in your burning application.

All the important tools are loaded to memory in this setup, so after you boot on this CD you can remove it and use things like ImageX to restore or make an image of a Vista install for backup or restore. You can use diskpart and format to prep a hard drive for an install, etc.... Putting these things in memory was a consideration for those who don't have two DVD/CD type drives for example and would need to restore an image from a DVD - you can take the WinPE boot CD out and put the DVD in with the image to be restored. It shouldn't use that much memory but you might notice the difference between 512 MB and 1 GB. The tools are loaded to ram drive X in memory. All you need to do is boot on the CD you created above. Everything is command line in a command prompt in winPE once you boot into it.

If you need help on a command in the WinPE command prompt after you boot on the CD you created, lets use ImageX as an example, simply type the command followed by '/?' i.e...Imagex /?.

I'm coding a nice GUI inteface for this process but its not ready yet. Hope this helps someone out.

step1_8bat.zip

Edited by Spooky
Link to comment
Share on other sites


Thanks alot for this. I've been looking at a PE build, but since it would only have been out of interest rather than to serve to real purpose, I didn't really look at the complex guides so it never really materialised.

This is a good way to start looking at it, thanks alot Spooky.

Edited by Biohead
Link to comment
Share on other sites

does this pe disc have support for WSH & HTA?

Can you advise how you add $oem$ type folders to a PE disc, for example if i wanted to copy a diskpart batch file to the systemdrive

you can easily add WSH and HTA support, in the CHM files that come with the WAIK you can see how it is done with PEIMG, you actually don't have to add a $oem$ folder you can add your diskpart file to the system32 folder, that is what i did, or the programfiles folder. download the WAIK and read through the help files, you will find everything that your need

Link to comment
Share on other sites

Kev,

I didn't go that far with it. This is just a basic 'beginners' helper thing I tought might interest those just getting started and needing a little help. Although you could eaisly develop it into what you need by following the advice of fizban2 in the reply just above this one.

does this pe disc have support for WSH & HTA?

Can you advise how you add $oem$ type folders to a PE disc, for example if i wanted to copy a diskpart batch file to the systemdrive

Link to comment
Share on other sites

  • 2 weeks later...

I have spent a large amount of time with PE 2.0 for a rather large IT company. In the spirit of sharing here are the scripts that I use to build my PE 2.0's.

First I start by creating a directory called PE in the root so it should look like this "C:\PE"

Download the BDD package from Microsoft's Connect web site. Which you can create a free account to obtain. Once the package is downloaded and installed there is an addition package that needs to be installed. This package is found in C:\Program Files\BDD 2007\WAIK\waikx86.msi Install it and then place the following scripts in C:\PE and follow the process of running the these scripts.

!EDIT!: http://www.microsoft.com/downloads/details...;DisplayLang=en

Go there and download the WAIK it is no longer included in the BDD file from connect.

1MakePE Directory.bat

rd /s/q c:\PE\winpe_x86

c:
cd "c:\program files\windows aik\tools\petools"
call copype.cmd x86 c:\PE\winpe_x86

pause

This will delete and re-create a directory called C:\PE\winpe_x86

2Mount.bat

cd \
cd c:\Program Files\Windows AIK\Tools\x86

imagex /mountrw c:\PE\winpe_x86\ISO\sources\boot.wim 1 c:\PE\winpe_x86\mount

pause

This mounts the boot.wim file which is the operating system itself and allows you to edit its settings. Anything you put in this mounted directory will be in the X:\ drive when the pe is booted. There is also a folder called ISO this is where you want files just on the CD but not in the mounted image.

3Packages.bat

cd \
cd c:\Program Files\Windows AIK\Tools\PETools\

peimg /install=WinPE-SRT-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-HTA-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-MDAC-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-Scripting-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-XML-Package c:\PE\winpe_x86\mount\Windows

::The packages have now been installed and will now be prepared.

pause

This installs the packages into the image which include HTA, MDAC, Scripting, XML and SRT. SRT is the recovery package which includes the System Recover applet.

4PrepareImage.bat

cd \
cd c:\Program Files\Windows AIK\Tools\PETools\

peimg /prep c:\PE\winpe_x86\mount\Windows

pause

This prepares your packages that were installed. This only needs to be done once unless you change the packages that are installed and does not do anything for any of the other data thats inserted into your mounted image.

5UnMount.bat

cd c:\Program Files\Windows AIK\Tools\x86\

imagex /unmount c:\PE\winpe_x86\mount /commit

pause

Once you are done changing the boot.wim OS file this will unmount the image.

6MakeISO.bat

cd \
c:
cd c:\Program Files\Windows AIK\Tools\PETools"

OSCDIMG -bc:\PE\winpe_x86\etfsboot.com -n -o c:\PE\winpe_x86\iso c:\PE\winpe_x86.iso

pause

This makes your .iso image.

Winpeshl.ini

[LaunchApp]
AppPath = %SYSTEMDRIVE%\NU2\nu2.exe
[LaunchApps]

This one is actually placed in the mounted \Windows\System32 directory and is the shell that is launched once its booted into PE. The nu2 line that is in there is not the shell that I use for my company but it is a good easy to modify shell which is why BartsPE uses it.

I personally dont like the "Hit any key to boot off CD" prompt and if your the same way go into the c:\PE\winpe_x86\ISO\boot\ and delete "BOOTFIX.BIN". Which will bypass the hit any key option and the system memory diagnostic menu.

Thats it! Pretty simple once its layed out. There are varying ways to do this same process and differences of opinions on ways to do each different part but this is the way that works for me.

PE.rar

Edited by paxamime
Link to comment
Share on other sites

I have created the Win PE 2.0 image using the same procedure.

We can also install WMI(Windows Managements Instrumentation) using the following cmd.

peimg /install=WinPE-WMI-Package c:\PE\winpe_x86\mount\Windows

What is the minimum system RAM required to boot a system using WinPE 2.0 ?

Thanks,

I have spent a large amount of time with PE 2.0 for a rather large IT company. In the spirit of sharing here are the scripts that I use to build my PE 2.0's.

First I start by creating a directory called PE in the root so it should look like this "C:\PE"

Download the BDD package from Microsoft's Connect web site. Which you can create a free account to obtain. Once the package is downloaded and installed there is an addition package that needs to be installed. This package is found in C:\Program Files\BDD 2007\WAIK\waikx86.msi Install it and then place the following scripts in C:\PE and follow the process of running the these scripts.

1MakePE Directory.bat

rd /s/q c:\PE\winpe_x86

c:
cd "c:\program files\windows aik\tools\petools"
call copype.cmd x86 c:\PE\winpe_x86

pause

This will delete and re-create a directory called C:\PE\winpe_x86

2Mount.bat

cd \
cd c:\Program Files\Windows AIK\Tools\x86

imagex /mountrw c:\PE\winpe_x86\ISO\sources\boot.wim 1 c:\PE\winpe_x86\mount

pause

This mounts the boot.wim file which is the operating system itself and allows you to edit its settings. Anything you put in this mounted directory will be in the X:\ drive when the pe is booted. There is also a folder called ISO this is where you want files just on the CD but not in the mounted image.

3Packages.bat

cd \
cd c:\Program Files\Windows AIK\Tools\PETools\

peimg /install=WinPE-SRT-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-HTA-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-MDAC-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-Scripting-Package c:\PE\winpe_x86\mount\Windows

peimg /install=WinPE-XML-Package c:\PE\winpe_x86\mount\Windows

::The packages have now been installed and will now be prepared.

pause

This installs the packages into the image which include HTA, MDAC, Scripting, XML and SRT. SRT is the recovery package which includes the System Recover applet.

4PrepareImage.bat

cd \
cd c:\Program Files\Windows AIK\Tools\PETools\

peimg /prep c:\PE\winpe_x86\mount\Windows

pause

This prepares your packages that were installed. This only needs to be done once unless you change the packages that are installed and does not do anything for any of the other data thats inserted into your mounted image.

5UnMount.bat

cd c:\Program Files\Windows AIK\Tools\x86\

imagex /unmount c:\PE\winpe_x86\mount /commit

pause

Once you are done changing the boot.wim OS file this will unmount the image.

6MakeISO.bat

cd \
c:
cd c:\Program Files\Windows AIK\Tools\PETools"

OSCDIMG -bc:\PE\winpe_x86\etfsboot.com -n -o c:\PE\winpe_x86\iso c:\PE\winpe_x86.iso

pause

This makes your .iso image.

Winpeshl.ini

[LaunchApp]
AppPath = %SYSTEMDRIVE%\NU2\nu2.exe
[LaunchApps]

This one is actually placed in the mounted \Windows\System32 directory and is the shell that is launched once its booted into PE. The nu2 line that is in there is not the shell that I use for my company but it is a good easy to modify shell which is why BartsPE uses it.

I personally dont like the "Hit any key to boot off CD" prompt and if your the same way go into the c:\PE\winpe_x86\ISO\boot\ and delete "BOOTFIX.BIN". Which will bypass the hit any key option and the system memory diagnostic menu.

Thats it! Pretty simple once its layed out. There are varying ways to do this same process and differences of opinions on ways to do each different part but this is the way that works for me.

Link to comment
Share on other sites

  • 1 month later...

Thanks for this wonderful guide. I was trying to do that myself and just wasn't able to until I got your bat files. Do you know if it is possible to slipstream drivers into the this pe like you could with the pe from the xp disc?

Edited by ElAguila
Link to comment
Share on other sites

Thanks for this wonderful guide. I was trying to do that myself and just wasn't able to until I got your bat files. Do you know if it is possible to slipstream drivers into the this pe like you could with the pe from the xp disc?

While you still have the WinPE2 wim file mounted, run this command:

%PETOOLS%\peimg.exe /inf:%DRIVERINF% %MOUNTROOTDIR%\Mount\Windows

Link to comment
Share on other sites

While you still have the WinPE2 wim file mounted, run this command:

%PETOOLS%\peimg.exe /inf:%DRIVERINF% %MOUNTROOTDIR%\Mount\Windows

I tried that but the raid driver that I am trying to slipstream uses a txtsetup.oem file. I tried it after step 3 and after step 4 but I got the same error. If I use the /inf and put the path I get the following error:

Installing INF package: e:\sil

PEIMG failed to complete the operation with status code 0x800f0003.

Edited by ElAguila
Link to comment
Share on other sites

that error message looks like you gave it the folder and not the inf file.

a full example of a correct command line:

"C:\Program Files\Windows AIK\Tools\PETools\peimg.exe" /inf:e:\Sil\name.inf C:\PE2\Mount\Windows

is that what you used?

All mass storage device drivers should come with a txtsetup.oem file, but this command requires a .inf file.

Edited by Jazkal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...