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.
Use a USB drive with at least 8 GB capacity, and remove any files that must be kept elsewhere.
DiskPart requires elevated privileges to modify disks and partitions.
C:\Windows\System32> diskpart Microsoft DiskPart version 10.0.22621.1 Copyright (C) Microsoft Corporation. On computer: DESKTOP-EXAMPLE
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.
DISKPART> select disk 1 Disk 1 is now the selected disk.
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.
DISKPART> clean DiskPart succeeded in cleaning the disk.
The selected disk is erased by clean, including all partitions and data.
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.
DISKPART> create partition primary DiskPart succeeded in creating the specified partition.
DISKPART> select partition 1 Partition 1 is now the selected partition.
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.
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.
DISKPART> assign letter=U DiskPart successfully assigned the drive letter or mount point.
DISKPART> exit Leaving DiskPart...
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:).
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:14
Excluding install.wim keeps the copy compatible with FAT32 when the ISO contains a 4 GB+ WIM.
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.
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
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
C:\Windows\System32> PowerShell -NoProfile -Command "Dismount-DiskImage -ImagePath 'C:\ISO\windows.iso'"