Weird. I just tried it on 3 thumb drives, an SD card, an external HDD, and an external SSD and it worked fine on all of them.
So here is what I am doing:
I first mount my Windows ISO image by double-clicking it. It get mountes as K:
I run the batch file and choose the "Wipe" option. It creates the thumb drive, HDD, etc. with the two partitions assigned G: and H: on my particular system.
What's odd is that if it was able to successfully assign D: to the first partition on your system, it should have found D: as being in use the second time through and continued searching for another drive letter for that second partition.
Apologies for the difficulties. The intention was to try this method thatI've found to work on systems where I simply could not get any other method to work properly. The idea is that the boot process begins from the FAT32 partition and then it gets "handed over" to the NTFS partition. I have one system that will simply not boot from any external drive unless it is FAT32 and another that will start the boot process but then fail partially in if it is not FAT32 and this method works for both.
I hate to get you too far off on a tangent if this is not going to work, but below are the raw steps that this batch file is basically taking if you want to try it manually. If not, I completely understand
Note: The steps below are simplified to handle only x86 or x64 Windows images. The batch file is actually a bit more sophisticated in that it can handle Windows images that have both x64 and x86 editions in the same image. I've cut those steps from below to simplify this because it's probably extremely rare that anyone will be using a dual architecture image.
Manual Steps:
1) Run diskpart.
2) From the diskpart> prompt, run this command:
list disk
3) From the size of the disks, try to determine which disk ID is your thumb drive. If that is not enough information, run these commands to get more detail on the disk. In this example, I want more info on disk 4:
select disk 4
detail disk
Here is some sample output:
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 476 GB 0 B *
Disk 1 Online 3726 GB 0 B *
Disk 2 Online 465 GB 1024 KB *
Disk 3 Online 7452 GB 0 B *
Disk 4 Online 238 GB 0 B
DISKPART> select disk 4
Disk 4 is now the selected disk.
DISKPART> detail disk
SanDisk Extreme Pro USB Device
Disk ID: DC727760
Type : USB
Status : Online
Path : 0
Target : 0
LUN ID : 0
Location Path : UNAVAILABLE
Current Read-only State : No
Read-only : No
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : No
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 7 Z My Software NTFS Removable 238 GB Healthy
C:\MountPoints\My Software\
4) When you determine the correct disk, run these commands. I am assuming disk 4 in the following example:
select disk 4
clean
convert mbr
create partition primary size=2000
active
format fs=fat32 quick
assign
create partition primary
format fs=ntfs quick
assign
exit
NOTE: The assign commands will assign the next available drive letter. If you want to assign specific drives letters, for example E:, use the command assign letter=E.
5) We will now copy files from the source to the FAT32 and NTFS partitions on the thumb drive. To be clear, all the files and folders that you are being asked to copy come from your source folder such as a folder on your hard disk that contains all the Windows files, or from a mounted Windows ISO image.
Start by checking to see if your original source has a file called ei.cfg in \sources. If that file is already present, skip to step 6.
NOTE: My research indicates that the ei.cfg file my no longer be needed, however, it will not hurt anything to follow these steps and create it.
Create a text file called ei.cfg. We will use that below. Place the following 2 lines into that file:
[Channel]
Retail
Notes about ei.cfg: Let's say that you have a computer that shipped with Windows 10 Home, but you upgraded to Pro. You may find that when you try to perform a clean install, Windows simply starts installing Home and doesn't even show you the menu from which you can select other editions. By placing this file in the sources folder, we prevent that from happening.
Note that when doing an unattended install, this file is not needed because the autounattend.xml specifies the edition of Windows to install, but you can leave the ei.cfg in place as it won't hurt anything.
6) Follow these steps to copy files to your thumb drive:
• Copy all files and folders EXCEPT \sources to the FAT32 partition.
• If you are planning to use an autounattend.xml answer file, place it in the root of either the FAT32 or the NTFS partition.
• Create a folder called sources on the FAT32 partition.
• Copy the file \sources\boot.wim to the FAT32 partition \sources folder.
• Create a folder called sources on the NTFS partition.
• Copy all files and folders from the \sources folder EXCEPT boot.wim to the \sources folder on the NTFS partition.
• If you created an ei.cfg file, copy it to the \sources folder of the NTFS partition.
At this point, you should have a bootable thumb drive that can be booted from both BIOS and UEFI based systems.
NOTE: When booting on a UEFI based system, you may be presented with an option to boot either the FAT32 or the NTFS partition. Choose the FAT32 partition.