Create a Bootable USB Key (Thumb Drive) in Windows Vista/7 with the Command Line


This tip is for more experienced computer users and uses a powerful command that can wipe out a disk.

A bootable USB flash drive can be a handy thing to have. For one thing, you can try out other operating systems without messing with your hard drive. For another, you can have a tool for repairing Windows systems that won’t boot. Or you can use it to install software on a PC that has no DVD drive. 

There are various ways to make a USB key bootable and Gizmo discussed a free utility for this purpose a few months ago. His discussion was focused on installing a Linux operating system. In this tip, I’ll discuss making a USB bootable for any purpose. This approach uses a built-in command-line utility that comes with Windows Vista and Windows 7.

The command is “diskpart” and it can be used for a number of disk operations as well as for creating a bootable flash drive. It is actually a suite of commands in a separate shell that is described at this link. (The command is also present in Windows XP but can't be used on flash drives in that operating system.)

Open a command prompt with administrator rights and enter the following sequence of commands:

   list disk
   select disk {number}
   create partition primary
   select partition 1
ormat fs=fat32 quick

In the "select disk" command, replace {number} with the drive number of your USB drive as indicated when you ran the "list disk" command. Check and double check you choose the correct number since this procedure erases everything on the drive you select.

The format command given above will create a FAT32 file system. This creates a bootable USB key that can be used for many purposes, once appropriate files are added. For example, it can be used to install Windows 7 (if the flash drive is at least 4 GB and you have a Windows 7 license).

Note that If you wish to use the USB key to actually run Windows 7 or otherwise need NTFS formatting, you will need to replace "format fs=fat32 quick" with "format fs=ntfs" and also modify the boot sector.

Software for creating bootable USB keys

If you prefer a graphical user interface to the command line, you can download and install one of the numerous free programs for making a USB key bootable. One program that has a number of functions in addition to making a key bootable is EasyBCD. The procedure for using a bootable key to install Windows 7 is described here and many other places.  

A standalone utility that does not require installation is Bootable USB Drive Creator Tool. The download is in the RAR format and you will need a utility like 7-Zip to extract the files. This utility uses DOS boot files.

Check your BIOS

To boot with a USB key, you may have to configure your BIOS. Check the settings for your particular hardware.

Get your own favorite tip published!  Know a neat tech tip or trick?  Then why not have it published here and receive full credit?  Click here to tell us your tip.

This tips section is maintained by Vic Laurie. Vic runs a Windows blog called The PC Informant and also operates a computer education website.

Click here for more items like this. Better still, get Tech Tips delivered via your RSS feeder or alternatively, have the RSS feed sent as email direct to your in-box.

Please rate this article: 

Your rating: None
Average: 4.1 (39 votes)