Monday

How to Create a Bootable Drive Using Command Prompt (Window 11)

 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, take a backup of all the files on your USB drive and then connect it to your PC.
  2. Press the Win key, type cmd, and click on Run as Administrator under Command Prompt. You can also use PowerShell if you prefer it over Command Prompt.
    disk part windows 11 bootable drive
  3. In the Command Prompt window, type the following command and hit enter to launch the Windows Diskpart utility.

  1. DISKPART
  2. Next, type the following command to list all the available storage devices:
    LIST DISK
  3. Here, locate your USB drive. You can look at the Size column to determine your USB drive. In this case, the USB drive is listed as Disk 2.
  4. Next, type the following command to select your drive:
    SEL DISK 2
  5. In the above command, change DISK 2 with the number assigned to your USB Drive. For example, if you have a single SSD or SATA drive setup, your primary drive will show as DISK 0 and USB drive as DISK 1. It is of extreme importance that you select the right drive as the next step involves wiping clean the selected drive.
  6. Next, type the following command and hit enter to erase all the content from the drive:
    Clean
  7. Next, type the following command to create a primary partition:
    Create Partition Primary
  8. Next, type the following command to select the main partition:
    List Par
  9. Command Prompt will show the details of your USB drive.
    format usb drive windows 11 cmd
  10. Type the following command and hit enter to activate the partition:
    Active
  11. Then type the following command to format the USB drive. It is important to format the drive in NTFS format as the FAT32 format will cause the incorrect parameter error.
    FORMAT FS=NTFS LABEL=“BootableUSB” QUICK OVERRIDE
  12. Once done, type Exit and hit enter to exit the Disk Part utility.

Now you will need to mount the ISO image and then move its content to your USB drive.

mount ISO image Windows 11 Command Prompt
  1. To do this, type the following command and hit Enter to mount the Windows 11 ISO file:
    PowerShell Mount-DiskImage -ImagePath "C:\Users\UserName\Downloads\Win11_English_x64v1.iso"
  2. In the above command, replace the file path with the location of your Windows 11 ISO.
    cmd list volume
  3. Once the ISO is mounted, type the following command to launch Diskpart.
    Diskpart
  4. Next, type the following command to show the available volume.
    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. Note down the details of the ISO volume as you will be using it moving forward.
    list volume cmd windows 11
  6. Once you have the volume details for the Mounted ISO, type the following command to exit Diskpart:
    Exit
  7. Next, type the Mounted ISO volume letter and hit enter. For example, if your Mounted ISO volume letter is J, then 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 master boot code compatible with Bootmgr to the USB flash drive:
    Bootsect /nt60 I:
  10. In the above command, replace with the drive letter associated with your USB flash drive.
    copy iso files to usb drive
  11. Next, type the following command and hit Enter to copy 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 your Mounted ISO Volume and USB drive letter, respectively.
  13. The process may take a 5-10 minutes to complete. If the Command Prompt feels stuck, it is normal behaviour, so wait until the process is complete.
  14. If successful, you will see a Files (s) Copied message.

No comments:

Post a Comment