Home
» PC Tips
»
How to create USB Boot using Command Prompt
How to create USB Boot using Command Prompt
Creating a bootable USB for Windows operating system will be very simple if you know how to apply the right method. Besides using software that supports creating bootable USB such as Rufus , Hiren's boot ,... you also have another way to create a bootable USB without having to install any additional software on your computer. That is using Command Prompt.
Steps to use Command Prompt to create USB Boot to install Windows
If you don't want to use a third-party tool to create a bootable drive, you can use the Diskpart utility and Command Prompt to create installation media. Here's how to do it.
1. First, back up all the files on your USB drive and connect it to your PC.
2. Press the Win key , type cmd and click Run as Administrator in Command Prompt. You can also use PowerShell if you prefer that tool over Command Prompt.
Use Diskpart to create Windows 11 boot drive
3. In the Command Prompt window, type the following command and press Enter to launch the Windows Diskpart utility.
DISKPART
4. Next, type the following command to list all available storage devices:
LIST DISK
5. Here, locate your USB drive. You can look at the Size column to identify your USB drive. In this case, the USB drive is listed as Disk 2 .
6. Next, type the following command to select your drive:
SEL DISK 2
7. In the above command, replace DISK 2 with the number assigned to your USB drive. For example, if you have an SSD or SATA drive setup, your primary drive will show up as DISK 0 and the USB drive as DISK 1 . It is extremely important that you select the correct drive because the next step involves wiping the selected drive.
8. After the drive is erased, type the following command and press Enter to erase all contents from the drive:
Clean
9. Next, type the following command to create the primary partition:
Create Partition Primary
10. After creating the primary partition, type the following command to select the primary partition:
List Par
11. Command Prompt will display details about your USB drive.
Format USB drive in Windows 11 using CMD
12. Type the following command and press Enter to activate the partition:
Active
13. Then type the following command to format the USB drive. It is important to format the drive in NTFS format because FAT32 format will cause incorrect parameter error.
FORMAT FS=NTFS LABEL=“BootableUSB” QUICK OVERRIDE
14. Once finished, type Exit and press Enter to exit the Disk Part utility.
Now, you will need to mount the ISO image and then move its contents to your USB drive.
Mount Windows 11 ISO image in Command Prompt
1. To do this, type the following command and press Enter to mount the Windows 11 ISO file:
2. In the above command, replace the file path with the location of your Windows 11 ISO.
List volume in CMD
3. Once the ISO is mounted, type the following command to launch Diskpart.
Diskpart
4. Next, type the following command to display available volumes.
List volume
5. This will help you determine the drive letter for the mounted ISO file. In the Type column , the mounted ISO will be listed as DVD-ROM. And the Ltr column lists the letter associated with the volume. Make a note of the details about the ISO volume as you will be using it later.
List volume in CMD Windows 11
6. Once you have the volume details for the mounted ISO, enter the following command to exit Diskpart:
Exit
7. Next, type the mounted ISO volume letter and press Enter. For example, if your mounted ISO volume letter is J, type the following command and press Enter .
J:
8. Type the following command to boot from CD:
cd boot
9. Next, type the following command to apply the Bootmgr-compatible master boot code to the USB flash drive:
Bootsect /nt60 I:
10. In the above command, replace I with the drive letter associated with your USB flash drive.
Copy ISO file to USB
11. Next, type the following command and press Enter to copy the Windows 11 system files to the USB flash drive:
xcopy J:\*.* I:\ /E /F /H
12. In the above command, replace K: and I: with the Mounted ISO Volume and USB drive letters respectively.
13. This process may take 5-10 minutes to complete. If Command Prompt gets stuck, that is normal, so just wait until the process is complete.
14. If successful, you will see a Files(s) Copied message .
That's it! You can now use the bootable USB to clean install Windows 11.