How to install Windows RE on the hard disk

I have been getting a lot of questions about installing Windows RE on the hard disk. This is good news for us as that means many of you are actually trying out Windows RE. So here's the simple four step process.

Step 1: Choosing a partition to install Windows RE

The hardest part about installing Windows RE seems to be deciding where to install it. The following considerations should go into deciding which partition to choose (listed in the priority order):

  1. The partition should not be the same as the Windows OS partition. This is so that you can boot into Windows RE even if your OS partition becomes corrupt or inaccessible for any reason. This helps maximize the chances that you would be able to boot into Windows RE when your main Windows installation is in trouble.

  2. The partition should be hidden so that users do not accidentally delete files or corrupt the Windows RE installation in anyway. Microsoft has defined a special partition type for this specific purpose. On MBR disks, the partition should be assigned partition type 0x27. And on GPT disks, the partition should have the partition type GUID: {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC}.

  3. The partition should not interfere with any advanced volume management functionalities, such as dynamic volumes. Any hidden partitions after the Windows OS partition may interfere with dynamic volume creations. Therefore, the Windows RE partition should be created before the Windows OS partition.

In the Windows OPK and the Windows AIK, we have a couple of partition layout recommendations. These recommendations were made by following the above considerations. These recommendations are:

  1. If the machine is not BitLocker enabled, then the partition should be a hidden recovery partition allocated before the OS partition. It should be assigned type 0x27 on MBR disks and type {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC} on GPT disks. The partition should be at least large enough to hold the Windows RE WIM, 1.5GB should be plenty for the base Windows RE.

  2. If the machine is BitLocker enabled, then the BitLocker partition (a.k.a. the system partition) can be used for Windows RE installation.  It should be noted that when using this configuration, the Windows RE on the BitLocker partition cannot be used to launch the Complete PC restore application.


Note:- If you just want to experiment with Windows RE without creating a separate partition for Windows RE, you can choose any visible drive in Vista.


Step 2: Copying Windows RE Files

For the purposes of this post, I am going to assume a WIM-based installation. If you want to install an expanded Windows RE, please look at the Windows OPK or the Windows AIK for appropriate documentation.

You need to copy the following two files to the root of the partition you chose in step 1 above.

  1. winre.wim (you can build a winre.wim using the installation media and the Windows AIK, as described here)

  2. boot.sdi (you can find it in the Windows AIK, under C:\Program Files\Windows AIK\Tools\PETools\x86\boot)


Step 3: Configuring Windows RE

To configure Windows RE, you can use the SetAutoFailover.cmd script provided in the Windows AIK (under: C:\Program Files\Windows AIK\Recovery). If you copied Windows RE files on the D: in step 2 above, and assuming that D: is the first partition on the disk, you would use it as:

SetAutoFailover.cmd /target D: /wim /nohide

Note:- You need to run SetAutoFailover.cmd from an elevated command prompt. To open an elevated command prompt, search for cmd.exe in the search box off Start button, then right click on the cmd icon in search results and choose Run as administrator.


Step 4: Testing Windows RE Installation

To test that Windows RE is installed correctly on the hard disk - Restart your computer and press F8 very early during boot. If you press it early enough, you should see an Advanced boot menu. The first item on this menu should be "Repair your computer." Choosing this option will take you to Windows RE.

Comments (22)

  1. wosully says:

    This worked great for me the first time, and I think we should make this part of our image for recovery purposes.  

  2. jamesperrycms says:

    Hi, this is a fantastic concept – I’ve been seriously looking into how to install WinRE on the hard disk for all the Vista PC’s we build, as we’re planning on shipping a recovery solution on the hard disk, rather than ship external media. However, I’ve found that the autofailover breaks after running Sysprep /generalized and the PC no longer boots into WinRE after ‘first’ boot. We need to use the generalize command, because we mass duplicate the hard drives when an image is sealed. Any ideas on how to maintain the boot configuration data after generalizing? I’ve looked EVERYWHERE for any other referenece to this issue.



  3. WinRE says:

    Yes, generalizing a Windows image causes auto failover to break. This is known issue and there is a work around for it. You should run SetAutoFailover.cmd (or equivalent) during the OOBESystem phase of setup by setting this in your FirstLogonCommands.

  4. hswear3 says:

    Hi. My computer had Windows XP on Partition 1 and Windows Vista on Partition 2. I also had the recovery console installed on XP. I used Partition Magic to move the XP partition up and created a new small partition at the start of the disk for WinRE.

    After I rebooted, I couldn’t access XP (which was now on Partition 2). I used the WinRE notepad to edit boot.ini and now everything works.

    What’s confusing is that many drive letters have changed. I have 2 320 GB hard drives and 4 USB drives with 12 partitions (there’s a reason)!

    So my question is: "Is there a way to preconfigure the volume to drive letter mapping when building the WIM?"


  5. WinRE says:

    You may be able to assign drive letters using setup while installing Vista. Please look for documentation about Windows System Image Manager. The following component can be used to assign drive letters:


  6. jamesperrycms says:

    Regarding running the SetAutoFailover.cmd (I have this script) during the OOBESystem phase of setup – is there any supporting documentation for doing this? Also, as I’m looking to install WinRE on the hard drive, won’t the autofailover just break again, if the end user restores the factory image?

    Final question, there are numerous references to OEM’s being able to store this factory image into the WinRE partition, but again, very little information as to how to set this up, to allow the end user to easily restore the image from WinRE (I’ll be using a *.WIM Image). Do you know of any supporting documents? We don’t have any software developers here, so it would most likely have to be a ‘no frills’ script that is run from a command prompt that utilises Imagex.exe – has anyone managed to create a restore solution using this method yet?

  7. anony.muos says:

    I read about some sort of "Self-healing" functionality in Vista and Longhorn Server’s NTFS. Would you elaborate in detail on this?

  8. WinRE says:

    Regarding NTFS self-healing, you can find some information from the following WinHEC 2006 presentation:

  9. samsung says:

    Why your blog updated very slowly?

  10. How does one go about creating the magic hidden partitions on Longhorn Server?  I have created the WIM file and I’m ready to plop-n-drop, but I can’t figure out how to create the recovery partition before the Windows OS partition.  

    Any help is appreciated!


  11. jeffXYZ says:

    I like these articles, by reading over the less than recent posts I can see that I am a little late in posting (sorry). Anyway, I think it might also be a given that a user may want to have a backup Windows RE on CD. This is sort of a given, but for the record (helpful for running cloning utilities):

    #1 login to Windows PE build directory:

    copype.cmd x86 c:winpe2_x86

    #2 as stated in your blog post:

    mkdir c:winre_image

    mkdir c:winre_mount

    #3 as stated in your blog post:

    imagex.exe /export /boot e:sourcesboot.wim 2 c:winre_imagewinre.wim “WinRE”

    #4 as stated in your blog post:

    imagex /mountrw c:winre_imagewinre.wim 1 c:winre_mount

    #5 as stated in your blog post:

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



      2. Copy this file to WindowsSystem32 directory in your mounted Windows RE directory. For example, copy winpeshl.ini C:winre_mountWindowsSystem32

    #6 as stated in your blog:

    Unmount the image by using ImageX. For example,

    imagex.exe /unmount /commit c:winre_mount

    #7 now move winre.wim to folder c:winpe2_x86ISOsources and delete old boot.wim and rename winre.wim to boot.wim

    #8 finally, CD back to c:program filesWindows AIKToolsPETools and issue the following command:

    oscdimg -n c:winpe_x86ISO c:winpe_x86winpe_x86.iso

    Now burn winpe_x86.iso to a CD, this gives you a secondary Windows RE with your favorite utilities that can be accessed through a root command prompt.

  12. Perk says:

    HI, Great Blog and thanks for posting all your great advice, But……and it’s a big one..Ive been bashing my prune trying to get the setautofailover.cmd to apply the nescessary changes in the recovery partition in the OOBE system pass and it will not apply! it works fine if im in end user maode or audit mode but as far as im aware it needs to trigger the command during the OOBE as the generalize option will break it, i have done this and i can see it in pantherunattend.xml but if i OOBE /generalize nothing happens, the partition is still visable and F8 has just the regular options! am i the only one with this issue? Please any advice would be greatly appreciated!

  13. JSComputerTech says:

    What would need to be changed for a 64bit system?

    Would the winpeshl.ini still go in the system32 directory?

    Would i use the boot.sdi file from the amd64 directory or still use the x86 version?

    And if i want to add inf driver files would i have to be running inside a 64bit OS?

  14. sergejk says:


    I have followed steps to install it on HD, but there are errors …

    I manage to see the option "Repair your computer" in advanced menu with F8, but after i click on it i get the following error:

    boot selection failed because required device is inaccessible

    Is someone having a similar problem(s)?

    Any help would be appreciated …



  15. massiveoni says:


    i want to make a recovery partition like the one described above, but i would like to know, can i use WinRE to start the recovery process. i have made a backup/recovery image using the windows 7 backup/restore program (which is in the control panel) but you either need to launch it from the control panel, or a bootable dvd. the question i am asking is, am i able to use WinRE to start the recovery process and then use the backup image made using the windows 7 recovery program?

    also the way i would like to set up my hard drive is

    partition 1 = WinRE (big enough for WinRE)

    partition 2 = Windows (approx 240 gb)

    partition 3 = uTorrent (approx 240 gb)

    partition 4 = Recovery Image (approx 20gb)

    it is a 500gb drive, but the sizes are just ruff guesses atm, but you get the general idea.

  16. massiveoni says:

    otherwise i would set it up as

    partition 1 = WinRE (big enough for WinRE and recovery image. about 20gb)

    partition 2 = Windows (approx 240 gb)

    partition 3 = uTorrent (approx 240 gb)

  17. alissonwilker says:

    Nice post! But would you tell us how to do it for a Windows 7 RE? There is no setautofailover.cmd in AIK for Windows 7.

  18. alissonwilker says:

    Is it the setautofailover.cmd which makes Windows detect the Win RE is present? Because I have a second partition which holds my Boot Manager and I want to put Win RE there. So, I have to make Windows (which is in another partition) detect Win RE and make it accessible through F8 Advanced Boot.

  19. diddly says:

    I think this may be what everyone is looking for, hope it helps.

  20. ost to pst conversion says:


    Thanks for the contents above.  The <a href="">ost pst conversion </a>, is a software which is used to convert an ost file to pst format.


    <a href="">ost to pst conversion</a>

  21. Yosef Blass says:

    I have actually written a project that does this automatically from a Task Sequence and provided my WIM as well as scripts, the information can be found at the following link

  22. Moses says:

    Why not simplify the task as setup recovery console in XP, which only requires insert the product CD and type x:i386winnt32.exe /cmdcons to install the WinRE?

Skip to main content