How To

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 20

47 - How to install Windows Vista/7/SVR2K8 onto a USB drive (or any

partition)

Shop Amazon - New Releases in Computer Accessories


Unique hits
NT6_Fast_Installer.zip History:
2011-9-10 New version of NT6_Fast_Installer.zip available (fixes 'bootsect.exe not
found' error).
2012-11-08 New version of NT6_Fast_Installer.zip available (bcdboot error Status =
c000003a fixed if using an EFI Windows system to prepare the USB drive with -
found by James Leyden - thanks James!).
2012-11-15 Revised to use either Win7 bcdboot or Win8 bcdboot.
RMPrepUSB Blog - please leave a comment or feedback on RMPrepUSB or this Tutorial (please mention Tutorial number).

Contents

1. 1 Introduction
2. 2 Aim
3. 3 Equipment required:
4. 4 Method
5. 5 Booting the USB drive
6. 6 Pagefile relocation (virtual memory)
7. 7 ADDENDUM - Booting from a different system
8. 8 Troubleshooting
9. 9 Add USB 3.0 Drivers to an Offline Image by Using DISM
1. 9.1 Adding Intel USB 3.0 drivers

To boot Windows 8 from USB - please see Tutorial #53

<<<Click here for a 32GB USB 3.0 70MB/s USB pendrive!!!

Introduction
Please note: This tutorial enables you to prepare a USB drive so that you can boot
directly to Windows 7 from the USB drive. So now you can try Windows 7 without needing to install
it onto your internal hard disk! IT WILL ONLY WORK ON A USB 2.0 PORT (see instructions at the
end of this page for instructions on how to add USB 3 drivers).

This tutorial does not make a Windows installer USB drive, it actually puts a copy of
Windows 7 onto a USB drive and makes it bootable. When you have made it, you can
boot from it as follows:
1. Connect the prepared external USB drive (hard disk or Flash drive) to the
target system (use a USB 2.0 port NOT a USB 3.0 port!)
2. Switch on the system
3. Select the USB drive as the boot device in the BIOS boot menu
4. Now allow the system to boot to Windows 7 directly from the USB drive.

- it does not matter what is on the internal hard disk of the target system, even if the
internal hard disk is broken/not working.

This tutorial as based on fujianabc's Reboot.pro forum post 'NT 6.x fast installer:
install Win7 directly to USB external drive' and his excellent scripts (now with reg
tweak by 'cdob' from reboot.pro -USBBootWatcher is no longer required). The
instructions in that forum post #1 & #2 and some of the prompts in the installer.cmd
file that fujianabc provides were however confusing and potentially dangerous (you
could accidentally corrupt your system drive) - so I have slightly modified his script
to make it clearer and easier to use. It also now automatically finds and uses the 3 files
that are needed from the MS WAIK, so you don't need to manually copy them first.

The instructions below assume that you have a USB drive (USB Hard Disk -
recommended, or USB Flash drive - slow!) and you want to install Windows 7 onto it
using a Windows 7 install DVD (or ISO file) as the source. You can use any 32/64-bit
mix - e.g. use a Windows 7 64-bit PC to install say Vista 32-bit OS from a Vista 32-bit
installation DVD onto a USB drive, or use a Windows XP system to install Windows
7 64-bit onto a USB drive using this method. Note that some CPUs' (e.g. some
netbook Atom 32-bit CPUs) won't run a 64-bit OS, so a 32-bit version of Windows 7
is usually best for these.

Note that there are some pitfalls with this Windows USB drive once you have
successfully made it:
 You will need to activate Windows using a valid Product Key (which will be
locked to the hardware you booted it on) if you want a fully functional version
of Windows for over 30 days
 You cannot just plug the USB drive into another system. If you want to move
it to another system (once you have booted it on one system) then you need to
sysprep it (see ADDENDUM at the end of this page). This is because on first
boot, a fresh copy of Windows will detect what hardware is on the system and
install the correct drivers (including the drivers for the boot drive). If you try
to boot that USB drive on another system without running Sysprep, you may
just get a BSOD (0x0000007B blue screen of death error).
 No drivers are included in the image if a plain Windows installation DVD is
used as the source DVD. You will need to install drivers once Win7 is booting.
 A USB Flash drive will be quite slow (1-2 hours!) to install and run Windows
from, unless you use a fast USB 3 Flash drive, such as BUSBI Boost USB 3
(even on a USB 2 port, USB 3 Flash drives are usually faster than USB 2
drives, but not, of course, as fast as a standard USB hard drive or USB 3
drives on USB 3 ports). I highly recommend you use a USB hard drive or a
USB 3 Flash drive.
 Windows 7 does not contain many USB 3 compatible drivers - so if you try to
boot from a USB 3.0 port it will probably crash!

Alternatively - using this method, you could remove an internal hard drive from a
system, connect it to your main PC (either directly or using a USB drive caddy),
format it and install Windows onto it using the Installer.cmd script in the tutorial, and
then put the hard drive back into the original system (or a different system) and boot
it.

The procedure below works and has been tested using an ISO of the RTM/Gold
version of Windows 7 and the SP1 version of Windows 7.

Aim
To install a bootable Windows 7 (or Vista or Win2K8) OS onto an external USB
drive.
You need to follow this tutorial using a Windows PC (or possibly by booting to
WinPE v2 or v3).
The Windows files are taken from a source installation DVD or a mounted ISO file. If
you do not have a Windows 7 source DVD, you can download an ISO file (see
External Links page)
Equipment required:
1. A USB hard drive of at least 10GB NTFS formatted (which may be wiped
during this process). A Flash drive can be used but it will be slow!
2. The whole Microsoft WAIK for Windows 7 installed (or at least the files
bootsect.exe, bcdboot.exe and imagex.exe) or see Tutorial #83 for a method
of obtaining these files in about 30 seconds without needing to download and
install the whole WAIK.
3. The NT6_Fast_Installer.zip download from the Downloads page
4. A Windows 7 installation DVD (or ISO file which you can mount as a drive
letter) - see here to download a copy of Windows 7.
5. (optional) RMPrepUSB to partition the USB hard drive

The system you use is assumed to be a Windows 7 system, although if you install the
WAIK, these instructions should work on an XP system or later OS.

Method
1.You need to have a source DVD or a mounted ISO file (mounted as a drive letter). If
you only have an ISO file, you can use SlySoft Virtual Clone Drive or ImDisk or any
similar software to mount the ISO as a drive volume - e.g. O:. This allows the script to
access the files within the ISO file as a drive letter.

2. You may need to partition and format the target USB disk using RMPrepUSB
if it is not formatted as NTFS.

IMPORTANT: The USB disk volume must be formatted as NTFS and must be
allocated a drive letter by Windows.
Set RMPrepUSB settings 1 to 5, then click 6 Prepare Drive

3. Download NT6_Fast_Installer.zip (works for Win7 RTM/Gold and Win 7


SP1) from the Downloads page and extract the contents to an empty folder on your
PC's hard drive - let us say you cretae a new folder on the hard disk is called
C:\NT6Inst for the sake of this Tutorial.

4. Download and install the Microsoft Windows 8 WAIK files.


If you don't want to install the WAIK, you will need to manually copy the correct
versions of bootsect.exe, imagex.exe and bcdboot.exe (bcdboot.exe is already in
Win7) to the C:\NT6Inst folder.
See Tutorial #83 for a method of obtaining these files in about 30 seconds without
needing to download and install the whole WAIK. Download the files from
the Windows 8 WAIK and copy them to the C:\NT6Inst folder. If you
are running on a 64-bit version of Windows (not installing, but actually using a 64-bit
version of Windows to prepare the drive) then use the amd64 versions, if you are
using a 32-bit version of Windows then use the x86 versions of the tools.

If you already have the Windows 7 or Windows 8 WAIK installed, the 3 files needed
will be found and automatically copied to your C:\NT6Inst when you run the
Installer.cmd script.

5. Right-click on the file C:\NT6Inst\INSTALLER.cmd and choose Run as


Administrator. If any files are missing you will be informed.

6. You should now see a green window with some text. Hit Enter and the Enter
again.

7. Now find the Install.wim file on your Windows installation DVD (or mounted ISO
volume) - double-click to select it:
8. You will now be presented with a list of different Editions - these were all within
the Install.wim file that you selected, choose the one you want to install (remember
that you will need an activation key which matches the version you choose, if you
want to activate Windows).
9. Now you will be asked to select the target USB hard disk that you want to install
Windows onto:
Note: If the USB disk has files on it, the script will try to format it for you, you will
need to enter in the volume name to confirm this.

10. Now enter in the same USB drive letter again for the boot partition (use the same
USB drive letter again):
11. You will now be asked if the disk is a USB disk - answer Y.
If however, you intend to disconnect the drive and put the drive inside another
system (e.g. notebook) before you boot from it, then say No to this question.

12. Unless you have a Vista or Server 2k8 source DVD, you will be asked what drive
letter you want Windows to use when it boots from the USB drive. Use the default by
hitting Enter.
13. You will now be presented with a final summary screen - hit Enter to start the
installation and wait a while.
Check this carefully before you hit Enter!
Note that the Target Drive letters should be the same if your USB drive only has one
partition.
Installation completes in just 7 minutes for a USB 3.0 Hard Disk install

Booting the USB drive


Now use the Windows Safely Remove USB Device System Tray icon to dismount the
USB drive and then try it on a system to see if it boots!
Don't forget that once you have booted the image on one system, it will probably
crash if booted on a different system because the correct drivers for the first system
will already be installed on the previous boot.
Once Win7 is running, you will also need to add the correct third-party drivers to get
all the hardware working correctly.
To speed up the Windows installation, once booted from the USB drive and in
Windows, go to Device Manager and select Disk Drive and double-click on it. Then
select the Policies tab and enable the Better Performance (Enable write caching)
option.

WARNING: If you have installed the 'Gold RTM' first version of Windows, do not
update the version with a Service Pack update (SP1) as this could break the
installation - instead re-install using the SP1 ISO/DVD. Normal hotfixes and updates
will be OK though.

Pagefile relocation (virtual memory)


If you boot from a USB disk using a system that also has a working internal fixed
hard disk, then Windows will automatically create and use a pagefile.sys on the
internal hard drive. This will also prevents you from formatting or re-partitioning the
internal hard drive. If however, you boot from a system that does not have an internal
HDD, Windows will warn you that it cannot create a pagefile - Windows will not
create a pagefile on a 'removable' disk.
If you wish to make Windows use the USB hard drive for the page file, follow the
instructions on reboot.pro by karyonix here (and here for the latest 32/64 bit version
of diskmod and registry entries). Note that you should NOT use a pagefile on a USB
Flash drive as it will be even slower and will also wear out the Flash memory if used a
lot.

ADDENDUM - Booting from a different system


If you want to connect the USB drive to a different system, you may need to sysprep
the drive - otherwise it may crash on boot and also could prevent it from booting on
the original system again too (changes/corrupts boot files and registry)!

A Sysprep cmd file should be already present on the Windows Desktop, once the
system has booted from the USB drive - if you right-click on this and Run as
Administrator it will reset and shutdown the system. You can then boot the USB
drive on a different system that has different hardware. This sysprep command should
run from an administrator command prompt and uses the
command: \Windows\System32\sysprep\sysprep.exe /oobe /generalize /shutdown

Once the computer shuts down, you can boot the USB drive on a different system
which has different hardware. If you want to move it to another system again or back
to the first system, don't forget to run Sysprep again before you move it!

Troubleshooting
If the BCDBOOT command fails with a [0xC000003a] error Warning: Resource
files missing ... then you probably are running the Installed.cmd script on a Windows
system that has booted from a UEFI BIOS instead of an MBR BIOS. In this case
download bcdboot.exe from the Windows 8 WAIK and replace the version in your
C:\NT6Inst folder with the Windows 8 version and run Installer.cmd again.

If you are using a USB HDD drive and Windows 7 boots and shows a 'Performance
Options' form, this is due to having no page file. Windows will not create a page file
on a removable drive. If you have no internal disk available, you can create a page file
on the USB drive using this fix - see http://reboot.pro/9461/#entry86619.

Add USB 3.0 Drivers to an Offline Image by Using


DISM
Check this post here and here for instructions.

The following instructions have not been tested by me and so I cannot vouch that
they will work!

Note: You will need to download and install the Windows 7 or 8 WAIK onto your
'office' computer first before you can run DISM.

Before you run Installer.cmd to make the USB drive, you first need to add the USB 3
drivers to the \sources\install.wim file.

First extract the install.wim file from the Windows 7 install ISO onto your hard disk
so that it can be modified.

It is suggested that you disable your antivirus software and close all Explorer
windows now.

At an elevated (Run as Administrator) command prompt, navigate to the Windows


OEM Preinstallation Kit (Windows OPK) servicing folder, and type the following
command to retrieve the name or index number for the image you want to modify.

Dism /Get-WimInfo /WimFile:C:\test\images\install.wim

An index or name value is required for most operations that specify a WIM file.

Type the following command to mount the offline Windows image contained in the
install.wim file (change the name value to exactly the name of the version you intend
to use, as listed).

Dism /Mount-Wim /WimFile:K:\Sources\install.wim /Name:"Windows 7


xxxx" /MountDir:C:\test\offline

Instead of using /Name:"xxx" you can use for instance /Index:2 (for image number
2)

At a command prompt, type the following command to add a specific driver to the
image. You will need to have the correct USB 3.0 Windows 7 driver files available for
the intended target system(s).

Dism /Image:C:\test\offline /Add-Driver /Driver:C:\drivers\myUSB3driver.INF

Multiple drivers can be added on one command line if you specify a folder instead of
an .inf file. To install all of the drivers in a folder and all its subfolders use the /recurse
option. For example,

Dism /Image:C:\test\offline /Add-Driver /Driver:c:\drivers\USB3drivers


/Recurse

To install an unsigned driver, use /ForceUnsigned to override the requirement that


drivers installed on X64-based computers must have a digital signature. For example,

Dism /Image:C:\test\offline /Add-Driver /Driver:C:\drivers\mydriver.INF


/ForceUnsigned

Review the contents of the Windows\Inf\ directory in the mounted Windows image to
ensure that the .inf files were installed using Windows Explorer. Drivers added to the
Windows image are named Oem*.inf. This is to ensure unique naming for new drivers
added to the computer. For example, the files MyDriver1.inf and MyDriver2.inf are
renamed Oem0.inf and Oem1.inf.

At a command prompt, type the following command to commit the changes and
unmount the image.

Dism /Unmount-Wim /MountDir:C:\test\offline /Commit

Now run the Installer.cmd to install Windows 7 to your USB device.

Adding Intel USB 3.0 drivers


I received this email from L. Douglas:

I followed the steps at the end of your tutorial and was able to get the Intel USB 3.0
drivers added in to my install.wim image.

One word of caution: Disable antivirus during this process. It blocked Dism from making the
changes it needed to do.
I then was able to install to the USB HDD and it booted fine from USB 2.0
port. Unfortunately, Trying to boot from USB 3.0 port would still bluescreen.

I went into the registry after booting from USB 2.0 and changed:

HKEY_LOCAL_MACHINE -> SYSTEM -> ControlSet001 -> services -> iusb3hub

and

HKEY_LOCAL_MACHINE -> SYSTEM -> ControlSet001 -> services -> iusb3xhc

for both of those entries, I changed "Start" to "0" and "Group" to "Boot
Bus Extender"

This will vary based on the USB3 driver in use, but this worked for the Intel USB3
drivers.

3 - Download ImageX, BCDBoot and other WAIK tools

Extract ImageX.exe and other WAIK tools


JFX has made a nice tools that automatically extracts imagex, bcdboot and various
others useful files from the Microsoft Windows Automated Installation Kit (WAIK)
across the internet so that you do not have to download the >1GB WAIK installation
ISO and then install it just to get a few files!

I recommend you pick the Win 8 Waik Tools!

The tool can be downloaded from the link on this page - it can also be directly
downloaded from this site by clicking on this link.

Tick the options that you want and click the Download button. Once completed
(the Windows 7 option shown takes about 30-60 seconds), you will have a set of
folders located beneath the folder where the GetWaikTools.exe program was located.

waik_2 for the Vista WAIK tools


waik_3 for the Windows 7 WAIK tools
waik_4 for the Windows 8 WAIK tools

Here are the WAIK4 (Win8 WAIK) files extracted (there will be 2 or 3 folders for
each WAIK version, x86, amd64 and sometimes ia64)

\ADK_8.0.SFV
\amd64
\DISM.SFV
\x86
\amd64\bcdboot.exe
\amd64\bcdedit.exe
\amd64\bootsect.exe
\amd64\Dism
\amd64\imagex.exe
\amd64\oscdimg.exe
\amd64\wimgapi.dll
\amd64\wimmount.sys
\amd64\WimMountInstall.exe
\amd64\wimserv.exe
\amd64\Dism\compatprovider.dll
\amd64\Dism\dism.exe
\amd64\Dism\dism.Format.ps1xml
\amd64\Dism\dism.psd1
\amd64\Dism\dism.psm1
\amd64\Dism\dism.Types.ps1xml
\amd64\Dism\dismapi.dll
\amd64\Dism\dismcore.dll
\amd64\Dism\dismcoreps.dll
\amd64\Dism\dismprov.dll
\amd64\Dism\folderprovider.dll
\amd64\Dism\imagex.exe
\amd64\Dism\imagingprovider.dll
\amd64\Dism\logprovider.dll
\amd64\Dism\Microsoft.Dism.Powershell.dll
\amd64\Dism\pkgmgr.exe
\amd64\Dism\ssshim.dll
\amd64\Dism\vhdprovider.dll
\amd64\Dism\wimgapi.dll
\amd64\Dism\wimmount.sys
\amd64\Dism\wimmountadksetup.exe
\amd64\Dism\wimprovider.dll
\amd64\Dism\wimserv.exe
\x86\bcdboot.exe
\x86\bcdedit.exe
\x86\bootsect.exe
\x86\Dism
\x86\imagex.exe
\x86\oscdimg.exe
\x86\wimgapi.dll
\x86\wimmount.sys
\x86\WimMountInstall.exe
\x86\wimserv.exe
\x86\Dism\compatprovider.dll
\x86\Dism\dism.exe
\x86\Dism\dism.Format.ps1xml
\x86\Dism\dism.psd1
\x86\Dism\dism.psm1
\x86\Dism\dism.Types.ps1xml
\x86\Dism\dismapi.dll
\x86\Dism\dismcore.dll
\x86\Dism\dismcoreps.dll
\x86\Dism\dismprov.dll
\x86\Dism\folderprovider.dll
\x86\Dism\imagex.exe
\x86\Dism\imagingprovider.dll
\x86\Dism\logprovider.dll
\x86\Dism\Microsoft.Dism.Powershell.dll
\x86\Dism\pkgmgr.exe
\x86\Dism\ssshim.dll
\x86\Dism\vhdprovider.dll
\x86\Dism\wimgapi.dll
\x86\Dism\wimmount.sys
\x86\Dism\wimmountadksetup.exe
\x86\Dism\wimprovider.dll
\x86\Dism\wimserv.exe

GetWailTools.exe can also be run from the command line and so can be used in
Windows batch files - e.g. to get all WAIK files...

start /wait GetWaikTools.exe -win7 -win8 -vista -win7Dism -win8Dism -silent


-cURL:0 -ontop:0 -folder:WAIK
if errorlevel 1 echo "DOWNLOAD FAILED"
if errorlevel 1 goto :EOF
dir WAIK\waik_3\*.*

Download the WinPE.WIMs and WAIK Help files


JFX's tool does not extract the winpe.wim file. If you want to extract the Windows 7
WAIK3 version of this WIM file (for instance to modify it and use it as a boot.wim
winpe boot file) you can use the getWinPEWIMs.cmd script. This download uses
Nuno's re7zip.exe utility and 7zip to extract some chm help files and the winpe.wim
files.

If you need to add extra components to the winpe.wim (e.g. languages, wmi support,
scripting support, .Net, etc.) then you will need to download and install the whole
WAIK.

You might also like