Creating a bootable USB drive in Windows provides portable installation and recovery media for operating systems, firmware updates, and troubleshooting environments. USB-based boot media is typically faster than optical discs and remains a common requirement for reinstalling Windows or running repair tools on modern systems.
A bootable USB works by presenting a readable partition and file system that the firmware can load from at startup. For Windows installation media, the ISO contains both legacy boot components (for BIOS) and UEFI boot files under the \efi directory, and copying the ISO contents onto a correctly formatted USB volume makes those boot files available to the firmware.
The DiskPart clean command permanently removes partitions from the selected disk, so selecting the correct disk number is critical. FAT32 is widely compatible for UEFI boot, but it cannot store a single file larger than 4 GB, which affects some Windows ISOs that include install.wim; splitting the image into multiple .swm files avoids that limitation while keeping the USB FAT32.
Steps to create a bootable USB in Windows:
- Insert the USB drive.
Use a USB drive with at least 8 GB capacity, and remove any files that must be kept elsewhere.
- Open Command Prompt as Administrator.
DiskPart requires elevated privileges to modify disks and partitions.
- Start DiskPart.
C:\Windows\System32> diskpart Microsoft DiskPart version 10.0.22621.1 Copyright (C) Microsoft Corporation. On computer: DESKTOP-EXAMPLE
- List the connected disks.
DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 465 GB 0 B Disk 1 Online 14 GB 1024 KB
Match the USB drive by Size, and avoid selecting the internal system disk.
- Select the USB disk.
DISKPART> select disk 1 Disk 1 is now the selected disk.
- Confirm the selected disk details.
DISKPART> detail disk Generic USB Flash Disk Disk ID: 12345678 Type : USB Status : Online Path : 0 Target : 0 LUN ID : 0 There are no volumes.
The Type field commonly shows USB for removable flash drives.
- Remove all partition information from the selected disk.
DISKPART> clean DiskPart succeeded in cleaning the disk.
The selected disk is erased by clean, including all partitions and data.
- Convert the disk to MBR partition style.
DISKPART> convert mbr DiskPart successfully converted the selected disk to MBR format.
MBR boot media is broadly compatible across UEFI and legacy BIOS systems for removable USB drives.
- Create a primary partition.
DISKPART> create partition primary DiskPart succeeded in creating the specified partition.
- Select the new partition.
DISKPART> select partition 1 Partition 1 is now the selected partition.
- Mark the partition as active for legacy BIOS boot.
DISKPART> active DiskPart marked the current partition as active.
UEFI boot does not use the active flag, but setting it does not prevent UEFI boot on typical systems.
- Format the partition as FAT32.
DISKPART> format fs=fat32 quick label=BOOTUSB 100 percent completed DiskPart successfully formatted the volume.
FAT32 cannot store a single file larger than 4 GB, which can affect sources\install.wim on some Windows ISOs.
- Assign a drive letter to the USB volume.
DISKPART> assign letter=U DiskPart successfully assigned the drive letter or mount point.
- Exit DiskPart.
DISKPART> exit Leaving DiskPart...
- Mount the ISO file.
C:\Windows\System32> PowerShell -NoProfile -Command "Mount-DiskImage -ImagePath 'C:\ISO\windows.iso'"
The mounted ISO appears as a new drive letter (for example E:).
- Copy the ISO contents to the USB drive.
C:\Windows\System32> robocopy E:\ U:\ /e /xf install.wim ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Monday, December 22, 2025 14:12:03 Source : E:\ Dest : U:\ Files : *.* Excluded Files : install.wim ##### snipped ##### ------------------------------------------------------------------------------- Total Copied Skipped Mismatch FAILED Extras Dirs : 57 57 0 0 0 0 Files : 1234 1234 0 0 0 0 Bytes : 4.15 g 4.15 g 0 0 0 0 Ended : Monday, December 22, 2025 14:14:14Excluding install.wim keeps the copy compatible with FAT32 when the ISO contains a 4 GB+ WIM.
- Split install.wim onto the USB drive when the ISO contains it.
C:\Windows\System32> dism /Split-Image /ImageFile:E:\sources\install.wim /SWMFile:U:\sources\install.swm /FileSize:3800 Deployment Image Servicing and Management tool Version: 10.0.22621.1 Splitting image [==========================100.0%==========================] The operation completed successfully.
Skip this step when the ISO uses install.esd instead of install.wim.
- Verify the UEFI bootloader exists on the USB drive.
C:\Windows\System32> dir U:\efi\boot\bootx64.efi Volume in drive U is BOOTUSB Volume Serial Number is 12AB-34CD Directory of U:\efi\boot 12/22/2025 02:05 PM 1,193,024 bootx64.efi 1 File(s) 1,193,024 bytes - Verify the installation image exists under sources.
C:\Windows\System32> dir U:\sources\install*.* Volume in drive U is BOOTUSB Volume Serial Number is 12AB-34CD Directory of U:\sources 12/22/2025 02:06 PM 3,980,000,000 install.swm 12/22/2025 02:07 PM 3,980,000,000 install2.swm 12/22/2025 02:07 PM 1,224,567,890 install3.swm 3 File(s) 9,184,567,890 bytes - Dismount the ISO file.
C:\Windows\System32> PowerShell -NoProfile -Command "Dismount-DiskImage -ImagePath 'C:\ISO\windows.iso'"
- Safely eject the USB drive.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
