<p><a href="http://wincert.net/wp-content/uploads/2015/01/windows-7-2.jpg"><img class="alignnone size-full wp-image-547" src="http://wincert.net/wp-content/uploads/2015/01/windows-7-2.jpg" alt="Windows 7 Box,domain logon,admin pack,taskbar thumbnails,task scheduler,preview pane,windows 7,chrome theme,icon cache,admin shares,install the printer,drives,pagefile,user profile,viceversa,live mail,ISO file,installation path" width="720" height="340" /></a></p>
<p>Having a <a href="http://wincert.net/?p=54" target="_blank">USB key that will install multiple versions of Windows</a> is great, but what if you want to add other Windows PE images to it, above and beyond the installers? For example, what if you wanted to add a recovery environment, like the <a href="http://www.microsoft.com/windows/enterprise/products/mdop/dart.aspx" target="_blank">Microsoft Diagnostics and Recovery Toolset</a> (DaRT), or a BartPE environment, or any other Windows PE-based environments? <!--more--> Well, it’s not that hard to do, and I’ll document how to do it with the Microsoft DaRT x86 and x64 recovery ISOs that it creates in this example.</p>
<h3>Adding the DaRT files</h3>
<p>First, you will need to copy the files from the MS DaRT WinPE ISO image to your “Content” folder that was created when you <a href="http://www.cluberti.com/blog/2009/08/10/mdt-2010-and-deployment-from-a-usb-key/" target="_blank">used MDT 2010 as per my previous post</a>. The content folder should look something like this:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/000.png"><img style="display: inline; border-width: 0px;" title="000" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/000_thumb.png" alt="000" width="504" height="404" border="0" /></a></p>
<p>And the contents of the MS DaRT ISO image, once extracted to the hard disk, will look something like this:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/001.png"><img style="display: inline; border-width: 0px;" title="001" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/001_thumb.png" alt="001" width="504" height="404" border="0" /></a></p>
<p>You will need to go through this folder structure (boot, EFI, and sources) and copy to your “Content” folder anything from the MS DaRT contents that does not already exist as a file or folder in your “Content” folder. For example, the MS DaRT media is on the left, and the “Content” media is on the right:<br />
<a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/002.png"><img style="display: inline; border-width: 0px;" title="002" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/002_thumb.png" alt="002" width="504" height="148" border="0" /></a></p>
<p>And the “Content” folder looks like this afterwards:<br />
<a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/003.png"><img style="display: inline; border-width: 0px;" title="003" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/003_thumb.png" alt="003" width="504" height="313" border="0" /></a></p>
<p>The same with the EFI and sources folders from the MS DaRT media:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/004.png"><img style="display: inline; border-width: 0px;" title="004" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/004_thumb.png" alt="004" width="504" height="113" border="0" /></a></p>
<p>And the “Content” folder looks like this afterwards:<br />
<a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/005.png"><img style="display: inline; border-width: 0px;" title="005" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/005_thumb.png" alt="005" width="504" height="213" border="0" /></a></p>
<p>Since most WinPE distributions use a “boot.wim” file in the “sources” folder, and we’re going to have multiples, you’ll want to rename any boot.wim files you copy here to something else, preferably something descriptive. For example, I’ve renamed the boot.wim file from the x64 MS DaRT media I just copied over to “msdart64.wim” – this will be important later, when we create our boot entries:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/006.png"><img style="display: inline; border-width: 0px;" title="006" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/006_thumb.png" alt="006" width="504" height="126" border="0" /></a><br />
<a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/007.png"><img style="display: inline; border-width: 0px;" title="007" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/007_thumb.png" alt="007" width="504" height="126" border="0" /></a></p>
<p> ;</p>
<p>I’ve repeated the above process for the x86 MS DaRT media as well, and renamed the boot.wim from that media to “msdart86.wim”:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/008.png"><img style="display: inline; border-width: 0px;" title="008" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/008_thumb.png" alt="008" width="504" height="139" border="0" /></a></p>
<p>Once you’re done with all of this, the last bit needed is to use bcdedit to add the new .wim files to your boot menu, and copy the updated “Content” folder to your USB key.</p>
<h3>Using bcdedit to modify the boot menu</h3>
<p>You’ll need to open a command prompt into the boot folder of your “Content” media folder, and execute some bcdedit commands to modify the boot menu. To make sure you’re in the right folder, the dir listing output should look something like this:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/009.png"><img style="display: inline; border-width: 0px;" title="009" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/009_thumb.png" alt="009" width="504" height="276" border="0" /></a></p>
<p>What you will need to do is use bcdedit to edit the “bcd” file you see here – that file actually contains the boot configuration data used during boot, and we’re going to modify it to add the new .wim files we just copied over.</p>
<p>First, let’s look at the current boot configuration stored in this file. Run the command “<span style="font-family: Consolas; font-size: x-small;"><strong>bcdedit /store bcd /enum</strong></span>” to show the current boot manager configuration stored in the bcd file. You’ll note that we already have 2 entries here – one labeled “Litetouch Boot [MEDIA001] (x86)” and another labeled “Litetouch Boot [MEDIA001] (x64)” – also make a quick note of the default GUID in the {default} entry at the end of the device and osdevice lines, because you’re going to need this later:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/010.png"><img style="display: inline; border-width: 0px;" title="010" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/010_thumb.png" alt="010" width="504" height="286" border="0" /></a></p>
<p>To create a new entry, you just need to create a copy of the {default} boot entry, and give it a name. Use the command “<strong><span style="font-family: Consolas; font-size: x-small;">bcdedit /store bcd /copy {default} /d “<;name>;</span></strong>” to create a new entry called “<;name>;”. I’ve created a new entry called “Diagnostics and Recovery x64” by using the command “<span style="font-family: Consolas; font-size: x-small;"><strong>bcdedit /store bcd /copy {default} /d “Diagnostics and Recovery x64</strong></span>” – please note very carefully the GUID that the entry was copied to – you will need this to further modify the entry in the next steps:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/011.png"><img style="display: inline; border-width: 0px;" title="011" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/011_thumb.png" alt="011" width="504" height="21" border="0" /></a></p>
<p>The next thing you need to do is add the DEVICE that this boot entry is going to use – this is the .wim file that the entry is going to point to, and you do this via the “<span style="font-family: consolas; font-size: x-small;"><strong>bcdedit /store bcd /set <;GUID for the new entry>; DEVICE ramdisk=[boot]<;path to .wim file>;,<;GUID of default entry>;</strong></span>”. I’ve edited the new entry to point to the msdart64.wim file via the command “<span style="font-family: Consolas; font-size: x-small;"><strong>bcdedit /store bcd /set {c77ebc03-8748-11de-8cb4-00137228d4cf} DEVICE ramdisk=[boot]sourcesmsdart64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}</strong></span>” (remember I told you you’d need the GUID for the new entry, as well as the GUID from the default entry? – here is where you use them):”</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/012.png"><img style="display: inline; border-width: 0px;" title="012" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/012_thumb.png" alt="012" width="504" height="22" border="0" /></a></p>
<p>You will next need to add the OSDEVICE that this boot entry is going to use. This command is basically identical to the previous, except that “DEVICE” in the previous command is replaced with “OSDEVICE” – “<span style="font-family: consolas; font-size: x-small;"><strong>bcdedit /store bcd /set <;GUID for the new entry>; OSDEVICE ramdisk=[boot]<;path to .wim file>;,<;GUID of default entry>;</strong></span>”. I’ve edited the new entry to point to the msdart64.wim file via the command “<span style="font-family: Consolas; font-size: x-small;"><strong>bcdedit /store bcd /set {c77ebc03-8748-11de-8cb4-00137228d4cf} DEVICE ramdisk=[boot]sourcesmsdart64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}</strong></span>”:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/013.png"><img style="display: inline; border-width: 0px;" title="013" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/013_thumb.png" alt="013" width="504" height="22" border="0" /></a></p>
<p>If everything was successful, you should be able to run “<span style="font-family: Consolas; font-size: x-small;"><strong>bcdedit /store bcd /enum</strong></span>” and see your new entry at the end of the list:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/014.png"><img style="display: inline; border-width: 0px;" title="014" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/014_thumb.png" alt="014" width="504" height="389" border="0" /></a></p>
<p>If you want to add another (for example, I’m adding the x86 version of MS DaRT as well), just do the same steps over again for the new .wim file:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/015.png"><img style="display: inline; border-width: 0px;" title="015" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/015_thumb.png" alt="015" width="504" height="64" border="0" /></a><br />
<a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/016.png"><img style="display: inline; border-width: 0px;" title="016" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/016_thumb.png" alt="016" width="504" height="494" border="0" /></a></p>
<p>Once you’re done, you can replace what’s on your USB key with the new contents of the “Content” media folder. If you want to create an ISO image (for burning to DVD, or testing in a VM), you can open the Deployment Tools command prompt from the Windows AIK start menu folder, and run oscdimg on the “Content” folder. The command is “<span style="font-family: Consolas; font-size: x-small;"><strong>oscdimg –b”<;path to etfsboot.com>;” –h –u2 –m -l<;Volume Name>; “<;path containing content to be copied to ISO>;” “<;path and name of resulting ISO image>;</strong></span>” (note that –l in the command is a lower-case “L”, not an “I”). I’ve created my image via the command “<span style="font-family: Consolas; font-size: x-small;"><strong>oscdimg –b”C:Program FilesWindows AIKToolsPEToolsamd64bootetfsboot.com” –h –u2 –m –lINSTALLER D:Hybrid_MediaContent D:Hybrid_Mediainstaller.iso</strong></span>”:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/017.png"><img style="display: inline; border-width: 0px;" title="017" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/017_thumb.png" alt="017" width="504" height="137" border="0" /></a></p>
<h3>Seeing it in action</h3>
<p>If you boot your new USB key (or ISO image), you should now see the new boot entries:</p>
<p><a href="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/018.png"><img style="display: inline; border-width: 0px;" title="018" src="http://www.cluberti.com/images/Addingadditionalbootoptionstoyourdeploym_964A/018_thumb.png" alt="018" width="504" height="379" border="0" /></a></p>
<p>That’s it – and you could theoretically do this with any Windows PE-based .wim file. I used MS DaRT for this example, but you could use something like BartPE or any other Windows PE image.</p>
<p><a href="http://www.cluberti.com/blog/2009/08/12/adding-additional-boot-options-to-your-deployment-usb-key/" target="_blank">Cluberti.com</a></p>