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
- A USB pen drive, 4 GB or larger (8 GB recommended). All data on it will be erased.
- 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).
- An administrator account on the PC you’re preparing the drive on.
Step 1: Open Command Prompt as Administrator
- Click Start, type
cmd. - Right-click Command Prompt in the results.
- 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
- In the admin Command Prompt, type
diskpartand press Enter. - Type
list diskand press Enter. You’ll see all connected disks with their sizes. - 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 diskagain, 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.

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:
- 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.
- Open the mounted/extracted ISO in File Explorer.
- Select all files and folders (Ctrl+A), copy them (Ctrl+C).
- Open your USB pen drive in File Explorer, paste (Ctrl+V).
- Wait for the copy to finish — this takes several minutes. Don’t unplug the drive until it’s done.

Step 5: Verify and Eject
- Open the USB pen drive and confirm you see folders like
boot,efi,sources,supportand files likesetup.exeandautorun.inf. - 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.
Axee Davies is the founder of AxeeTech, publishing gaming guides, codes, and Windows how-tos since March 2013. A tech enthusiast for 13+ years — starting with smartphones and Android rooting — he now runs a site that puts out a new guide every day for Roblox players, traders, and Windows users. More about AxeeTech
More Windows You May Like
How to Fix samsung notes pc error sa_1036 on Windows
ESD-USB: How to Create a Bootable USB from a Windows ESD File
How to Use a Windows Spotlight Background Without the “Learn About This Picture” Icon
Windows 11 Registry Customizer: Classic Right-Click, Disable Copilot & Recall (.REG)
Windows Resource Protection Could Not Start the Repair Service
Night Light Not Working in Windows 11: 7 Easy Fixes
Windows 11 Update Stuck at 46%: 7 Proven Fixes
Start Menu Not Working in Windows 11: 7 Fixes That Work