Adding additional boot options to deployment USB
Having a USB key that will install multiple versions of Windows 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 Microsoft Diagnostics and Recovery Toolset (DaRT), or a BartPE environment, or any other Windows PE-based environments? 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.
Adding the DaRT files
First, you will need to copy the files from the MS DaRT WinPE ISO image to your “Content” folder that was created when you used MDT 2010 as per my previous post. The content folder should look something like this:
And the contents of the MS DaRT ISO image, once extracted to the hard disk, will look something like this:
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:
And the “Content” folder looks like this afterwards:
The same with the EFI and sources folders from the MS DaRT media:
And the “Content” folder looks like this afterwards:
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:
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”:
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.
Using bcdedit to modify the boot menu
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:
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.
First, let’s look at the current boot configuration stored in this file. Run the command “bcdedit /store bcd /enum” 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:
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 “bcdedit /store bcd /copy {default} /d “<name>” to create a new entry called “<name>”. I’ve created a new entry called “Diagnostics and Recovery x64” by using the command “bcdedit /store bcd /copy {default} /d “Diagnostics and Recovery x64” – 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:
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 “bcdedit /store bcd /set <GUID for the new entry> DEVICE ramdisk=[boot]<path to .wim file>,<GUID of default entry>”. I’ve edited the new entry to point to the msdart64.wim file via the command “bcdedit /store bcd /set {c77ebc03-8748-11de-8cb4-00137228d4cf} DEVICE ramdisk=[boot]sourcesmsdart64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}” (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):”
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” – “bcdedit /store bcd /set <GUID for the new entry> OSDEVICE ramdisk=[boot]<path to .wim file>,<GUID of default entry>”. I’ve edited the new entry to point to the msdart64.wim file via the command “bcdedit /store bcd /set {c77ebc03-8748-11de-8cb4-00137228d4cf} DEVICE ramdisk=[boot]sourcesmsdart64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}”:
If everything was successful, you should be able to run “bcdedit /store bcd /enum” and see your new entry at the end of the list:
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:
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 “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>” (note that –l in the command is a lower-case “L”, not an “I”). I’ve created my image via the command “oscdimg –b”C:Program FilesWindows AIKToolsPEToolsamd64bootetfsboot.com” –h –u2 –m –lINSTALLER D:Hybrid_MediaContent D:Hybrid_Mediainstaller.iso”:
Seeing it in action
If you boot your new USB key (or ISO image), you should now see the new boot entries:
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.
Great Article, Just what i was looking for !
Thank you so much for your great and nice article,it was exactly what i was looking for.
Thanks for article.
For those who prefer a GUI;
download EasyBCD. (current 2.1.2)
You are gonna love it, I promise.
I struggled wiht command line for days.
EasyBCD fixed it in 5 minutes with a few clicks.
My problem was that I had 4 entries (made by Keith Garners MDT USB Tool)
Booting up on USB, only showing 2 entries.
hey guys,
i like the idea alot to have this integrated in my own built windows 7 iso, however it’s dutch, should that give any problems?
and i just aio’ed my iso in a 22 in 1 wim. the basic imagex’ing. any idea on how to slipstream it into the disc?
This article is just what i have been looking for 🙂 thanks heaps
@Fiekert123
You can check our forums where you can get help regarding slipstream to the disc question.
Regards,
Nik