UPDATE: OK, this all still works, but given that MS has made a GUI tool available that does the whole thing, why bother. A free download from the Microsoft Store is the Windows 7 USB/DVD Download Tool. Grab a copy, and keep it available on your general tools USB stick. Of course, if you haven’t got that with you, then the following procedure is still valuable. I’ve used it innumerable times.
There are lots of ways to make a bootable USB flash disk (Pendrive, USB stick, Flashdrive, or whatever you call it), but most require you to download something you don’t already have. However, if the goal is to make a bootable Windows Vista/Windows 7/Windows Server 2008/R2 USB installation drive to install Windows on a server or other computer that doesn’t have a DVD drive in it, then you already have all the required software. All you need is a USB flashdrive of 4GB or more and the installation DVD. The rest is just a bit of command line fun. On a Windows computer that does have a DVD drive, do the following:
- Insert the target USB disk (in this case, a 16 GB pen drive)
- Insert the source DVD disk (drive letter is D: and it’s a Windows Server 2008 R2 DVD)
- Open a PowerShell or CMD window As Administrator
- Type diskpart and press <Enter>
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 111 GB 0 B
Disk 1 Online 16 GB 0 B
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> active
DiskPart marked the current partition as active.
DISKPART> format fs=ntfs quick
100 percent completed
DiskPart successfully formatted the volume.
DISKPART> assign
DiskPart successfully assigned the drive letter or mount point.
DISKPART> exit
Leaving DiskPart...
PSH>
Now, assuming your DVD drive with the Server 2k8 R2 DVD in is D:, and your target USB drive is H:
PSH> D:\boot\bootsect /nt60 h:
Target volumes will be updated with BOOTMGR compatible bootcode.
H: (\\?\Volume{3887d21d-23b9-11df-ab70-00e0b889184e})
Successfully updated NTFS filesystem bootcode.
Bootcode was successfully updated on all targeted volumes.
PSH>
[EDIT: 30 June 2010] I should have been clearer. The operation above needs to be done on a 64-bit Windows computer if this is a 64-bit target, and on a 32-bit computer if it's a 32-bit target.
Now, finally, copy the contents of the source DVD to the new bootable USB stick:
PSH> xcopy d:\*.* h:\ /e /h /j
When the copy is finished, you’ll have a bootable USB drive.
Now, finally a couple of comments and cautions. First, you need to use a source disk and a computer to do this on that are compatible. So either both need to be 64-bit, or if for some reason you try to do this on a 32-bit Windows but want to make a 64-bit install USB stick, then you’ll need to juggle DVDs a bit since the bootsect.exe that you run must match the architecture of the computer you’re running it on.
Second, if you don’t like xcopy, and you’re running this on a Win7 computer or have robocopy available, then you can use the robocopy command:
PSH> robocopy d:\ h:\ /mir
Third (and this should be obvious, but just in case), you’ll need to adjust your drive letters and the selected disk in diskpart.exe to match your environment.
Finally, if you’re working from an ISO image, you can mount that ISO image as if it were an actual DVD disk using a utility such as VirtualCloneDrive. (This is freeware, no nag, and really useful!)
All this because my new HP DL160se G6 came with no optical drive at all. But more on that HP later.