Creating a WIM file containing the Windows RE
October 9, 2007
Q. In Windows Vista, how do I create a Windows Imaging Format (WIM) file containing the Windows Recovery Environment (RE)?
A. The Windows RE is essentially a Windows Preinstallation Environment (WinPE) instance that calls the Recovery Environment (recenv.exe) file at startup. You can therefore create a WIM file containing WinPE, which will run recenv.exe on initialization. To perform this you must install the Windows Automated Installation Kit (AIK), which you can download at http://www.microsoft.com/downloads/details.aspx?FamilyID=c7d4bc6d-15f3-4284-9123-679830d629f2&DisplayLang=en#Instructions). To create the WIM file, perform these steps:
Create a new folder to hold the Windows RE and a folder to mount the created RE WIM file. To do so, use the following commands:
mkdir d:tempwinre_imagemkdir d:tempwinre_mount
Extract the second image from the boot.wim of the Vista media into a new RE WIM file. The second image contains the Windows Longhorn setup version of WinPE. Use the following command to extract the image:
C:Program FilesWindows AIKToolsPETools>imagex /export /boot "D:OS ImagesWindows Vista Final English DVD Images (x86 and x64)boot.wim" 2 d:tempwinre_imagewinre.wim "Windows RE"
Now mount the new RE image, by using this command:
C:Program FilesWindows AIKToolsPETools>imagex /mountrw d:tempwinre_imagewinre.wim 1 d:tempwinre_mount
Navigate to the d:tempwinre_mountWindowsSystem32 folder and create a file called winpeshl.ini. In winpeshl.ini add the following text:
[LaunchApp] AppPath=x:sourcesrecoveryrecenv.exe
Optionally, you can add more storage drivers via the peimg command, as the following example shows:
peimg.exe /inf= d:tempwinre_mountWindows
Dismount the imageby usinf the following command:D:tempwinre_mountWindowsSystem32>imagex /unmount /commit d:tempwinre_mount
You now have a WIM file with the Windows RE environment, which you could use, for example, with Windows Deployment Services (WDS).
— John Savill
About the Author
You May Also Like