Welcome to MSDN Blogs Sign in | Join | Help

Syndication

Tags

    No tags have been created or used yet.
Creating Window RE Using Windows AIK

We have been getting many questions on how to create Windows RE using the Windows Automated Installation Kit (AIK). So I thought I would publish the updated instructions here. The instructions listed below are accurate as of Windows Vista RTM.

 

These instructions are also included in the Windows AIK. Please note that the ReadMe file that accompanies the Windows AIK contains an important update to the instructions.

 

Note: If you install Windows RE using the Windows OPK, please continue to follow the instructions in the Windows OPK. Those instructions remain unchanged. Use these instructions only if you do not have access to the Windows OPK.

 

Step 1: Copy Windows PE from the Installation Media

The version of Windows PE that ships with the Windows AIK does not contain the components required to support Windows RE. However every Windows installation disk contains Windows RE that can be used for recovery of Windows Vista. Therefore, we will use the Windows RE from the Windows installation media.

  1. On your technician computer, click Start, point to All Programs, then Windows AIK, and then click Windows PE Tools Command Prompt.
    The menu shortcut opens a command prompt window and automatically sets environment variables to point to all the necessary tools.
  2. Create a directory for the Windows PE image and a mount point

            mkdir c:\winre_image

            mkdir c:\winre_mount

  1. Copy the Windows PE image from the installation media using ImageX

            imagex.exe /export /boot e:\sources\boot.wim 2 c:\winre_image\winre.wim “Windows Recovery Environment”

  1. Mount the image using ImageX

            imagex /mountrw c:\winre_image\winre.wim 1 c:\winre_mount

Step 2: Add Windows RE shell script

The Windows PE we copied in step 1, does not launch Windows RE automatically. In this step, we will create a script called winpeshl.ini that will launch the Windows RE shell at startup.

  1. By using a text editor, create a file called winpeshl.ini that contains the following text:

    [LaunchApp]

    AppPath=x:\sources\recovery\recenv.exe

  1. Copy this file to \Windows\System32 directory in your mounted Windows RE directory. For example,

              copy winpeshl.ini c:\winre_mount\Windows\System32

Step 3: Add mass-storage drivers (optional)

If necessary, you can include third-party drivers (.inf) in your Windows RE image by using the peimg.exe /inf command. For example,

    peimg.exe /inf=<path> C:\winre_x86\mount\Windows

        Where <path> is the location of the. inf file.

Step 4: Add custom tools to Windows RE (optional)

You can customize Windows RE shell by creating an .xml file called WinREConfig.xml. WinREConfig.xml enables you to define custom support and diagnostic tools within Windows RE. This step is optional. For more information, refer to the Windows RE documentation in the Windows AIK.

Step 5: Save changes to the image

Unmount the image by using ImageX. For example,

    imagex.exe /unmount /commit c:\winre_mount

 

That's it! The WinRE.wim file is now ready to be deployed on the harddisk or a WDS server. Let us know if these updated instructions do not work for you.

-Parveen

Published Tuesday, December 12, 2006 8:10 AM by WinRE

Comments

# re: Creating WinRE Using WAIK @ Sunday, January 07, 2007 3:02 PM

Number 3 will not function for me at all: I have the AIK installed and Vista disk:

  3. Copy the Windows PE image from the installation media using ImageX

           imagex.exe /export /boot e:\sources\boot.wim 2 c:\winre_image\winre.wim “Windows Recovery Environment”

wosully

# re: Creating WinRE Using WAIK @ Sunday, January 07, 2007 3:39 PM

What error do you get from imagex?

WinRE

# re: Creating WinRE Using WAIK @ Sunday, January 07, 2007 4:07 PM

It states a syntax error, and shows me the imagex switches.  Do you think I am doing something incorrect here?  Running imagex from the elevated command prompt, Windows PE.

Great articles, by the way!

wosully

# re: Creating WinRE Using WAIK @ Sunday, January 07, 2007 4:27 PM

Seems to work fine for me. May be check the following:

1. Double check the arguments.

2. Make sure that you have write permission to the folder where you are copying the image.

3. Also check that you are using the correct boot.wim. You can run "imagex /info boot.wim" to make sure that it has two images in it.

WinRE

# re: Creating WinRE Using WAIK @ Sunday, January 07, 2007 7:37 PM

OK, I got it.  I just copied it from the DVD manually, then everything went well.  

Thanks!

wosully

# How to install WinRE on the hard disk @ Thursday, January 11, 2007 8:44 PM

I have been getting a lot of questions about installing WinRE on the hard disk. This is good news for

Windows RE Notes

# re: Creating WinRE Using WAIK @ Friday, January 12, 2007 9:33 AM

I got the same problem as wosully.

I changed the syntax to

imagex.exe /export /boot e:\sources\boot.wim 2 c:\winre_image\winre.wim “WinRE”

and now it works.

Great job, especially the "install WinRE on the hard disk" article!

philippk

# re: Creating WinRE Using WAIK @ Tuesday, March 06, 2007 12:25 PM

First off, I would like to say this is a great site. However, could you dive into more detail with the WinREConfig.xml file. I am unable to get it to work properly. I created the tools folder under the working directory where RecEnv.exe is and added teh WinREConfig.xml file there as well. I modified the contents for the application I want to launch, but it does not show up on the System Recovery Options list. I just get the normal choices. I can launch my utilities through the command prompt, but I would rather be able to launch the front end through the System Recovery Options list.

Thank you for your time!

James

Armitage

# re: Creating WinRE Using WAIK @ Tuesday, March 06, 2007 3:29 PM

Can you share your winreconfig.xml file? It should have worked fine. The following works for us:

<Recovery>

<RecoveryTools>

 <RelativeFilePath>FabDiag.exe</RelativeFilePath>

</RecoveryTools>

</Recovery>

Please note that the RelativeFilePath is relative to the x:\sources\recovery\tools directory, and the WinREConfig.xml file should be placed under the x:\sources\recovery\tools directory as well.

WinRE

# re: Creating WinRE Using WAIK @ Tuesday, March 06, 2007 4:37 PM

Here is how my winreconfig.xml file is laid out:

<Recovery>

<RecoveryTools>

<RelativeFilePath>nu2menu.exe</RelativeFilePath>

</RecoveryTools>

</Recovery>

The winreconfig.xml file is in the tools folder which is under the recovery folder. The nu2menu.exe is in teh root of the tools folder.

From my understanding it is supposed to add this to the menu that pop's up correct? If not, what is the use of adding this file?

Armitage

# re: Creating WinRE Using WAIK @ Tuesday, March 06, 2007 5:05 PM

Well, tried it again and it works now. I went ahead and moved everything into the root directory instead of it being in a folder underneath tools. However, I did have the RelativeFilePath set to Nu2menu\nu2menu.exe. Also, I made sure both the tools directory and the winreconfig.xml file were lowercase. I am doubtfull that made any differences. Anyways, it is working now. Thank you for you help!

James

Armitage

# Comment créer WinRE à partir du WAIK @ Wednesday, March 07, 2007 8:34 AM

Un article qui pourra être intéressant pour ceux qui parmi vous, cherchent à récupérer WinRE qui n'est

Blog de David Sebban [MSFT]

# re: Creating WinRE Using WAIK @ Monday, March 12, 2007 5:52 AM

I managed to run through the step as outlined and everything went as expected, however when i try to access the "Repair My Coputer" option. The files will seminly load, the windows screen appears, and the computer restarts.

Any ideas. Could it be the hard drive i have it on, or missiong files. Do SATA drives require a driver to be inluded?

mccay_a

# re: Creating WinRE Using WAIK @ Monday, March 12, 2007 3:54 PM

Hi, What's in your winpeshl.ini file? Is it in the right place?

Thanks,

-Parveen

WinRE

# re: Creating WinRE Using WAIK @ Tuesday, March 13, 2007 6:25 PM

Hi there,

I am a big fan of WinRE, however, I have a quick question:

Is it possible to edit the text and/or icon of the custom recovery tool specified between the <RecoveryTools> tags - I would like to launch a HTA here if possible but would also like it to look nice on the menu!

Also, being cheeky, could you tell me what the WinRE front end was written in please?

Many Thanks, keep up the good work! cheers, Jamie.

purejamie

# How to change text of Custom Recovery Tool @ Tuesday, March 27, 2007 3:35 PM

Hello,

I had no problems creating the WinREConfig.xml

and the option is working fine.

However, the text of my custom tools on the Recovery menu is set to "Unknown".

Is there anybody who managed to give his custom recovery tool

Herman

# re: Creating WinRE Using WAIK @ Wednesday, March 28, 2007 3:08 AM

(sorry, I accidentally hit ENTER)

Is there anybody who managed to give his Custom Recovery Tool a more decent name

in the Recovery menu ?

Or am I the only one who sees "Unknown" as

description of the tool ?

Please let me know what you see in your case.

It is urgent for me.

Thank you in advance !

Herman

# re: Creating WinRE Using WAIK @ Wednesday, March 28, 2007 3:24 AM

Hi Herman,

The tool name is taken from the version resource of the tool. WinRE uses the GetFileVersionInfo() API to extract this information: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/versioninformation/versioninformationreference/versioninformationfunctions/getfileversioninfo.asp

So embed the name of tool in the ProductName field and embed the description of the tool in the FileDescription field of the version resource of your binary.

WinRE

# re: Creating WinRE Using WAIK @ Wednesday, March 28, 2007 2:10 PM

Dear sir,

Now I understand why I had no meaningful name

as menu option.

My custom recovery tool was in fact a .CMD file, (a .bat file) containing commands and not a compiled program.

This is a great Blog, and the concept of WINPE is indeed a major progress for people like me who wants to have a recovery/install environment from a removable device with access to the NTFS file system.

But there is so little information to find what kind of programs, tools we can run under it. I've programs in VB6 and .net 2.0 (console and Windows forms).

I've looked everywhere to find more information about the limitations of WINPE 2.0 and WINRE 2.0.  

Okay, I can run Notepad but that's almost the only GUI application. What about a GUI filemanager ?  Will VB6 programs run, and what are the limitations. I already know I can forget .net framework.

I understand also why Microsoft wants this WINPE/WINRE to be limited, but what kind of GUI applications can run under it ?

Or do I have to forget my GUI dreams, and focus on cscript.exe and wscript.exe to run scripts ?

I know I'm asking a lot here, but this seems to be the right place to get answers.

Kind Regards,

Herman

# re: Creating WinRE Using WAIK @ Friday, March 30, 2007 4:19 AM

Hi Herman,

WinRE supports base Win32 API. So any GUI applications that only use native Win32 should work fine. Notepad, Startup Repair, Complete PC Restore are all examples of such applications. Winforms are not supported.

So yes, using cscript- and wscript- based scripting is a good option for this limited environment.

Thanks,

-Parveen

WinRE

# The new WAIK Documentation update is not up-to-date ! @ Monday, April 02, 2007 4:54 PM

I noticed today (April, 2) that Microsoft

released a documentation update for the WAIK, which can

be downloaded from :

http://www.microsoft.com/downloads/details.aspx?FamilyID=993c567d-f12c-4676-917f-05d9de73ada4&DisplayLang=en

However, the instructions on how to create WinRE (from the WinPE.chm file) still don't mention that the WINRE isn't included in the WAIK, and that it must be extracted from the Vista DVD :

imagex.exe /export /boot e:\sources\boot.wim 2 c:\winre_image\winre.wim “Windows Recovery Environment”

I don't understand that this essential item wasn't corrected.

Herman

# re: Creating WinRE Using WAIK @ Monday, April 02, 2007 6:19 PM

Hi Herman,

You can find the latest Windows AIK documentation with an updated Windows RE walkthrough on Microsoft TechNet at:

http://technet2.microsoft.com/WindowsVista/f/?en/library/61e08b15-82d8-46bd-a5f1-7947193e6ed81033.mspx

The content on Microsoft TechNet is more recent than the packaged documentation update for Windows AIK on Download Center.

Thanks,

Desmond

WinRE

# Documentation Update @ Tuesday, April 03, 2007 2:18 PM

Thank you Desmond. I saw the updated content on Microsoft Technet a few days ago. That's why I didn't understand they released a documentation update without the right installation instructions.

Best Regards,

Herman

# Windows Deployment Services @ Monday, May 07, 2007 11:16 AM

Deploying BDD is a big project. One of the first elements, and a huge time saver, is installing WDS.

The Lazy Admin

# re: Creating Window RE Using Windows AIK @ Tuesday, August 21, 2007 10:06 AM

Hi,

I have tried using the instructions in Step 3 to install network drivers but it does not seem to work. The peimg.exe /inf command executes successfully but when I boot into WinRE, there is no network connectivity.

I have successfully installed the exact same drivers on WinPE by following the instructions provided by Microsoft and it works.

Is it possible to have WinRE access a network? Am I missing a step?

Thanks,

Matt

mattdunn

# re: Creating Window RE Using Windows AIK @ Friday, October 05, 2007 11:19 AM

Hi there,

I am trying to create a customized version of Windows RE and I was wondering a few things.

1) Just like the person above I was wondering if it is possible to add network connectivity to WinRE. If so how?

2) Is it possible to add more than one custom recovery tool to WinRE? I've been trying to play around with the .XML file with no success.

3) Is there any difference when creating WinRe with WAIK versus WOPK? Is WOPK more flexible on what tools/options you can add to WinRE?

Thanks,

Anthony

abucci

# re: Creating Window RE Using Windows AIK @ Monday, December 24, 2007 7:45 AM

Hi !

- I had read your article in detail, it is a great masterpiece which I was looking for a very long time.

- I could reproduce and creat a WinRe, just as you said.

But I ran into a problem where I would like ot ask your help as I tried evertyhing I could.

- When WinRe starts it is asking for the default keyboard, than you have push the Next button once more as you system search for Windows Installation. How can I bybass these dialogs ? My target is to jump directly to Complete PC Restore. I am sure it is possible, but I dont know how.

Could you help me please with step by step help please ?

Many thank you for yoru time and effort,

Andrew

coolice

# re: Creating Window RE Using Windows AIK @ Friday, May 09, 2008 3:48 AM

No Answers on the blog anymore ?

I'm searching for a way to design a WIN RE environment with network access (RDP e.g.) WIN RE in not more or less than PE 2.0, so why not.

Regards

Data1701

Data1701

# re: Creating Window RE Using Windows AIK, Vista SP1 @ Sunday, August 17, 2008 10:11 AM

1.

Using Vista x64 SP1

imagex.exe /export ... 2 ...

did not work for me. I got a syntax error, and showing the imagex switches.

imagex.exe /info shows PE being image index 1

Using image 1 the extract worked.

When starting repair usind F8 I got the error:

"Windows PE cannot start because the actual SYSTEMROOT directory (X:\Windows) is different from the configured one (X:\$Windows.~BT\Windows). This can be configured with peimg /targetpath..."

I solved this using:

peimg /targetpath=x:\ c:\winre_mount

Now it works

pmeinl

# Found out how to get network connectivity in WinRE! @ Saturday, January 03, 2009 6:57 PM

Hey everybody, I'm not sure if anyone else found this out or not - but I found a way to get WinRE working with network connection.

You still need to install the network drivers on the image so WinRE can see your NIC(s), but as some have noted on here, that's not enough to get it to work.

It's really simple, actually. WinPE uses a script when it starts which initializes Plug and Play devices + Network connectivity. That script is located in <WinPE mount directory\Windows\System32\startnet.cmd

Inside this script is the all-too-familiar wpeinit command. Run that, and you have network connectivity in WinRE, now.

This solution works for temporary network connectivity, but it you want full network connectivity from the start of your WinRE session, then what I did is modify the \Windows\System32\Winpeshl.ini file and changed it from starting RecEnv.exe (The WinRE Recovery GUI) to starting startnet.cmd. Of course, the way Winpeshl.ini seems to work is that when the application it starts is closed, the system reboots. So, add a line to startnet.cmd which calls RecEnv.exe, and WinRE will start with network connectivity and will behave like normal from then on until RecEnv.exe is closed, which returns control to startnet.cmd, which finishes, and reboots the computer. All just like normal!

I had some security concerns with launching startnet.cmd at first because it might give unauthorized access to a user that starts WinRE on a client machine via the command prompt that pops up, but the call function seems to lock out the command prompt window until control is returned to it. So, I'm pretty sure that it's still secure to deploy on client systems if you intend to do that like I do.

Anywho, hope this helps. This information seems to be a little difficult to find.

Teqonix

# re: Creating Window RE Using Windows AIK @ Thursday, January 29, 2009 11:48 PM

Plz help. When I type imagex.exe in command prompt it says batch unrecognised. Plz tell if I have to download anything or what to do. I am very much perplexed. Do I have to download the AIK KIT.

Navneet12

# re: Creating Window RE Using Windows AIK @ Thursday, January 29, 2009 11:49 PM

Plz help. When I type imagex.exe in command prompt it says batch unrecognised file type . Plz tell if I have to download anything or what to do. I am very much perplexed. Do I have to download the AIK KIT.

Navneet12

Anonymous comments are disabled
Page view tracker