Thursday, 21 November 2013

How to create bootable usb by using command prompt

I thought I would share this tutorial I put together in response to some users having difficulty creating a bootable USB drive for windows 7 in RT7Lite (I have never tried to use that function as I always create an ISO).   I got the basic commands from the net and am going to take you step by step through the process without having to use a 3rd party program using the command prompt to utilize DiskPart which is built into Windows 7 by default.


* Insert you USB drive into your computer and remove the contents from the drive.

*Open command prompt by typing in
cmd in the start menu search box and hit enter.

*First we need to know which number is assigned to the USB we are going to make bootable by typing in "diskpart" and hit enter

Posted Image

*Now type "list disk" and hit enter and you will see all of you drives with numbers assigned like this

Posted Image

In this case my 4gig USB drive was Disk 2 ( make sure you don't choose the wrong disk or you will end up erasing the disks contents, I can't be held responsible for your mistake)  
*Next type in "select disk 2" (or whichever you disk is) and hit enter

Posted Image

*Next type "clean" and hit enter

Posted Image

Next type "create partition primary" and hit enter

Posted Image

*After you see the in the above image that it has successfully created a primary partition on the selected disk you chose, type "select partition 1" and hit enter.  (Don't confuse partition number with disk number.  As they are not the same, you need to just type "select partition 1")

Posted Image

*Type "active" and hit enter

Posted Image

*Type "format fs=fat32" and hit enter.  You will see progress in percent like image below.
*When it completes process type "assign" and hit enter.
( you can also use "format fs=fat32 quick" for quick format , and also any other fat version or ntfs version  but fat32 is better than those)
Posted Image

*Type "exit" and hit enter

Posted Image

*Just leave command prompt open as we are going to add one final command which will update the Bootcode on all volumes and the USB will be bootable for Windows 7.

*Either insert your Windows DVD or in my case I mounted my ISO using PowerIso and check to see what drive letter it has been assigned.  My ISO of Windows was mounted to drive letter "E" and my USB was assigned drive letter "G".

Type in this command: "e: cd boot" and hit enter

Posted Image

*Type "cd boot" and hit enter

Posted Image

Type this final command, "bootsect.exe /nt60 g:" and hit enter and you should see this (remember you must use the drive letters assigned to the specific drive letters you are working with):

Posted Image

As you can see it now says we have successfully updated NTFS filesystem bootcode.

*Final step is you are going to have to extract the DVD contents or the ISO contents to the USB Drive.  I  used Power Iso and right clicked my unmounted image and chose extract to and then chose my drive letter "G".  You could also use 7zip or Winrar for the iso as it doesn't really matter.  After it is done extracting the contents you now have a fully bootable Windows 7 USB.

Posted Image

Posted Image 

0 comments:

Post a Comment