Make a Windows 7 USB Pen Drive Bootable with Diskpart

If you’d rather not download any software, Windows has everything you need built in. The diskpart command-line tool can prepare a USB pen drive so it boots the Windows 7 installer, no Rufus, no third-party utilities. It takes a few more steps than the Rufus GUI method, but it works on any Windows PC and teaches you exactly what’s happening under the hood.

For newer ESD-based install images, we also cover how to create a bootable USB from a Windows ESD file.

Warning: diskpart will permanently erase the disk you select. If you pick the wrong disk number, you can wipe your hard drive. Read the “double-check” step below carefully before running clean.

What You Need

  1. A USB pen drive, 4 GB or larger (8 GB recommended). All data on it will be erased.
  2. A Windows 7 ISO file — plus a way to get its contents onto the drive (Windows 8/10/11 can mount ISOs by double-clicking; on Windows 7 you’ll need a free tool like 7-Zip to extract it).
  3. An administrator account on the PC you’re preparing the drive on.

Step 1: Open Command Prompt as Administrator

  1. Click Start, type cmd.
  2. Right-click Command Prompt in the results.
  3. Select Run as administrator and click Yes on the UAC prompt.

Diskpart cannot modify disks without admin rights — you’ll get an “Access Denied” error otherwise. (More on why in our run as administrator guide.)

Step 2: Start Diskpart and Find Your USB Drive

  1. In the admin Command Prompt, type diskpart and press Enter.
  2. Type list disk and press Enter. You’ll see all connected disks with their sizes.
  3. Identify your USB pen drive by its size. This is the critical step — e.g., if your pen drive is 16 GB and your hard drive is 500 GB, the 16 GB disk is the pen drive.
DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          465 GB      0 B
  Disk 1    Online           14 GB      0 B

In this example, Disk 1 (14 GB) is the USB pen drive.

Double-check now. Unplug the pen drive, run list disk again, and confirm the disk disappears. Plug it back in and confirm it reappears. Only then proceed.

Step 3: Clean and Prepare the Pen Drive

Run these commands one at a time, replacing 1 with your USB drive’s actual disk number:

select disk 1
clean
create partition primary
select partition 1
active
format fs=ntfs quick
assign
exit

What each command does:

  • select disk 1 — targets your USB pen drive. (Use your disk number, not necessarily 1.)
  • clean — erases the partition table. This is the destructive step — there is no undo.
  • create partition primary — creates one partition using the full drive.
  • select partition 1 — targets the new partition.
  • active — marks the partition bootable. This is what makes the BIOS treat it as a boot device.
  • format fs=ntfs quick — formats as NTFS. Windows 7’s install.wim often exceeds 4 GB, which FAT32 can’t hold.
  • assign — gives the drive a letter so it shows up in File Explorer.
  • exit — closes diskpart.
USB Pen Drive: Command Prompt showing the diskpart command sequence completing with "DiskPart successfully..." messages
Command Prompt showing the diskpart command sequence completing with “DiskPart successfully…” messages

Step 4: Copy the Windows 7 Files to the Pen Drive

The drive is now bootable but empty. You need the Windows 7 installation files on it:

  1. Mount or extract the ISO. On Windows 8/10/11, double-click the ISO to mount it as a virtual drive. On Windows 7, extract it with 7-Zip.
  2. Open the mounted/extracted ISO in File Explorer.
  3. Select all files and folders (Ctrl+A), copy them (Ctrl+C).
  4. Open your USB pen drive in File Explorer, paste (Ctrl+V).
  5. Wait for the copy to finish — this takes several minutes. Don’t unplug the drive until it’s done.
File Explorer showing Windows 7 ISO contents (boot folder, setup.exe, sources folder) copied to the USB drive
File Explorer showing Windows 7 ISO contents (boot folder, setup.exe, sources folder) copied to the USB drive

Step 5: Verify and Eject

  1. Open the USB pen drive and confirm you see folders like boot, efi, sources, support and files like setup.exe and autorun.inf.
  2. Use Safely Remove Hardware (the USB icon in the system tray) before unplugging.

Your pen drive is now a bootable Windows 7 installer. Plug it into the target PC, restart, and boot from USB via the boot menu (F12/F8/Esc/Delete depending on brand).

Why This Method Works

A bootable drive needs three things: an MBR partition table (diskpart’s default when you clean a drive on a BIOS/MBR system), an active primary partition, and bootable files copied onto it. The active flag is the key — it’s what tells the PC’s firmware “you can boot from here.” Everything else is just file copying.

If the PC Won’t Boot from the Drive

The diskpart method produces a correctly structured drive, so boot failures are almost always firmware settings: boot order, Secure Boot, or Legacy/CSM mode. Walk through our Windows 7 USB boot troubleshooting guide — the most common fix is disabling Secure Boot and plugging into a USB 2.0 port (the Windows 7 installer has no USB 3.0 drivers).

Official reference: the diskpart command syntax is documented on Microsoft Learn.

Frequently Asked Questions

Is the diskpart method better than Rufus?

Not better — just different. Rufus (our GUI guide) is faster and harder to get wrong. Diskpart needs no downloads and works anywhere, but one wrong disk number can wipe your data. Beginners should use Rufus.

How do I know which disk is my USB pen drive?

Match it by size in list disk. To be certain, run list disk with the drive unplugged, then again with it plugged in — the disk that appears is yours.

Can I use FAT32 instead of NTFS?

Not recommended for Windows 7. FAT32 can’t store files over 4 GB, and Windows 7’s install.wim frequently exceeds that. NTFS is the safe choice.

Does this work for Windows 10 or 11 ISOs too?

The diskpart steps work for preparing the drive, but Windows 10/11 ISOs are designed for UEFI/GPT boot and the file-copy method alone may not produce a UEFI-bootable drive. For Windows 11, use our dedicated Windows 11 bootable USB guide.

Conclusion

Diskpart gives you a bootable Windows 7 USB pen drive with zero third-party software: clean, create partition primary, active, format NTFS, then copy the ISO contents over. It’s powerful precisely because it’s low-level — so verify your disk number twice before running clean, and you’ll have a working installer in about fifteen minutes.

More Windows You May Like

Leave a Reply

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