How To Install Windows 7 From USB With Microsoft’s Command Line

There are many advantages of installing an operating system such as Windows 7 from a USB. For instance, it installs quicker from a USB rather than an optical drive like a DVD Rom because of the superior bus speed of the former. There are many freeware available for making a bootable USB. However, some of them can be a bit dysfunctional and unreliable.

The most reliable way of creating a bootable USB is perhaps by the Microsoft command line. In this post we will tell you how to create a bootable USB for Installing Windows 7. The same command can also be used to install a number of other Windows based operating system, including numerous versions of Windows Server 2008 (including R2).

Open a command prompt from the Start Menu. You can type cmd in the start menu or Run to open it.


After that, type the following commands after inserting a USB.


  1. diskpart
  2. list disk (to show the available disk drives)
  3. select disk 1 (assuming disk 1 was your thumb drive in the above list disk command)
  4. clean
  5. create partition primary
  6. select partition 1
  7. active
  8. format fs=fat32
  9. assign
  10. exit

After that, copy Windows 7 from a DVD ROM from the following command

11. xcopy d:*.* /s/e/f e: (assumes your dvd is drive D: and your thumb drive is drive E: (adjust accordingly).

Restart your system to boot from the USB and to install the operating system (Windows 7, Windows Server 2008 ,etc). Normally your system will automatically boot from the USB, if it does not, check your boot settings from BIOS and make sure that USB boot is enabled in the boot sequence.

To find out how to make a bootable USB from a software check out our post “Make a bootable USB installer for Windows XP, Vista, 7 with WinToFlash”.