How to Create a Bootable USB with CMD in Windows 11/10

Anwar AlamAnwar AlamPublished Apr 16, 2022Updated Aug 27, 20266 min read0 comments
Bootable USB with CMD using DiskPart and FAT32 for Windows installation media

You can create a bootable USB with CMD using tools already included with Windows 11 and Windows 10. The process prepares a USB drive with DiskPart, mounts an official Windows ISO, and copies the installation files to the drive.

The important part is choosing the correct disk and using FAT32 for broad UEFI compatibility. One wrong select disk command followed by clean can erase another drive, so verify the USB by both its size and current contents before continuing.

Quick Answer

Download an official Windows ISO, mount it, open Command Prompt as administrator, and use DiskPart to clean the correct USB drive and format it as FAT32. Copy the ISO files to the USB. If sources\install.wim is larger than 4 GB, copy everything else first and split that file with DISM.

  • A blank USB flash drive with at least 8 GB of capacity. Everything on it will be erased.
  • A Windows 11 or Windows 10 PC with an administrator account.
  • An official Windows ISO that matches the edition, architecture and language you need.
  • Enough free space to store the ISO while you prepare the drive.

For Windows 11, use Microsoft’s Download Windows 11 page. Microsoft recommends a blank USB because its contents will be deleted. Avoid modified ISO files from unverified download sites.

Warning

DiskPart’s clean command erases the selected disk’s partition information. Disconnect unnecessary external drives, back up the USB, and confirm the disk number carefully. The example uses Disk 2; your USB may have a different number.

Step 1: Mount the Windows ISO

  1. Find the downloaded ISO in File Explorer.
  2. Right-click it and choose Mount. If Mount is not shown, select Open with and then Windows Explorer.
  3. Open This PC and note the new virtual DVD drive letter. This guide uses D: as the example.

Keep the mounted ISO open. You will copy its files after preparing the USB.

Step 2: Identify the USB Drive in DiskPart

Insert the USB drive. Open Start, search for Command Prompt, choose Run as administrator, and approve the User Account Control prompt. Then enter:

				
					diskpart
list disk
				
			

Compare the sizes in the list with your USB drive. Do not select a disk based only on its position. If you are unsure, type exit, unplug the USB, run list disk again, reconnect it, and compare the two lists.

Step 3: Clean and Format the USB as FAT32

Replace 2 below with the actual number of your USB drive. These commands erase the selected disk, create one primary partition, format it as FAT32, and assign a drive letter:

				
					select disk 2
detail disk
clean
create partition primary
select partition 1
format fs=fat32 quick label=WINSETUP
assign
exit
				
			

Use the output from detail disk as your final identity check before entering clean. FAT32 is the safest choice for installation media that must boot on modern UEFI PCs. The older article’s universal NTFS and active advice is not appropriate for every modern system.

Steps to create a bootable USB with CMD: mount the ISO, format FAT32, copy files, and split a large install.wim with DISM
The safe workflow: mount the official ISO, format the correct USB as FAT32, copy the files, and use DISM when install.wim exceeds FAT32’s limit.

Step 4: Copy the Windows Installation Files

Open File Explorer and note the USB drive letter. This example uses E: for the USB and D: for the mounted ISO. If the ISO does not contain a file larger than 4 GB, copy everything with:

				
					robocopy D:\ E:\ /E
				
			

Wait for Robocopy to finish and review its summary. Do not remove the USB while files are being written. If the copy fails because install.wim is too large, use the next section instead of reformatting the drive as NTFS.

If install.wim Is Larger Than 4 GB

FAT32 cannot store one file larger than 4 GB. Microsoft documents a supported workaround: copy all files except sources\install.wim, then split that image into smaller .swm files. Windows Setup recognizes the split files when they remain together in the USB’s sources folder.

				
					robocopy D:\ E:\ /E /XF D:\sources\install.wim
Dism /Split-Image /ImageFile:D:\sources\install.wim /SWMFile:E:\sources\install.swm /FileSize:3800
				
			

Replace D: and E: with your actual ISO and USB letters. Microsoft’s USB installation-media guide uses this same 3,800 MB split size. If your ISO contains install.esd rather than install.wim, the normal copy may succeed because the ESD file is often smaller.

Related guide

Use the completed USB to reach Windows Recovery Environment and repair startup files.

Step 5: Test the Bootable USB

  1. Use File Explorer’s Eject command and remove the USB safely.
  2. Connect it to the target PC while that PC is powered off.
  3. Turn the PC on and open its one-time boot menu. Common keys include F12, Esc, F9 or F11, but the manufacturer’s instructions are authoritative.
  4. Select the USB entry marked UEFI.
  5. Confirm that Windows Setup or the recovery screen opens. You can then exit without starting an installation.

If the USB is not listed, try a different port, recreate the FAT32 partition, disable Legacy/CSM mode only if appropriate for that PC, and check the manufacturer’s boot-menu instructions.

Common Problems and Safe Fixes

  • “Access is denied” or DiskPart cannot clean the drive: reopen Command Prompt as administrator and confirm the USB is not open in another program.
  • The wrong disk was selected: stop immediately. Do not create partitions or format anything else. If important data was on that disk, avoid writing to it and seek recovery help.
  • Robocopy reports files were skipped: check the summary and available USB space. Use the DISM method specifically for an oversized install.wim.
  • The USB boots on one PC but not another: check whether the target uses UEFI, Secure Boot, or an unusual architecture. An x64 Windows 11 ISO will not serve every Arm-based device.
  • Windows Setup cannot see the internal drive: the PC may require a storage-controller driver from its manufacturer. Do not randomly change storage modes when an existing installation contains important data.

Frequently Asked Questions

Yes. The DiskPart clean and format steps remove the USB’s existing partitions and files. Back it up and confirm the disk number before continuing.

FAT32 offers the broadest UEFI boot compatibility. When install.wim exceeds FAT32’s 4 GB file limit, keep FAT32 and split the WIM with DISM.

Usually not for a modern UEFI Windows installation USB prepared as FAT32. Older BIOS-specific media may use different steps, but this guide focuses on current UEFI systems.

No. Mount the ISO and copy its contents. A USB containing only the single ISO file normally will not start Windows Setup.

Keep the USB for Recovery

Once the USB successfully reaches Windows Setup, label it with the Windows version and architecture. Recreate it when you need newer installation files rather than assuming an old image is current.

The CMD method is useful when you want to understand and control each step. If you prefer an automated approach, Microsoft’s Media Creation Tool is simpler. Either way, use official installation files and protect every drive before running destructive commands.

Facebook
X
LinkedIn
Get the Weekly Fix

One email a week. Real fixes, no fluff.

Subscription Form

Join the discussion

Leave a Reply

Your email address will not be published. Required fields are marked *