Bootable USB

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5
At a glance
Powered by AI
The document outlines the process of creating a bootable USB drive that can be used to install Windows PE and additional tools.

The steps outlined are to clean and format the USB drive to FAT32 or NTFS, install the boot sector, and copy over the necessary WinPE files.

The Windows Automated Installation Kit (WAIK) is used to install WinPE files to the USB drive. Tools like copype.cmd, imagex, and startnet.cmd are used in the process.

Creating a Boot USB Drive

B o o t a bl e USB
Topics Covered:

Making USB Device Bootable.


Installing WinPE on Device.

Making USB Device Bootable

Information gotten from http://4sysops.com/archives/windows-7-usbdvddownload-tool-wudt-is-unable-to-copy-files/

1. Launch a command prompt with admin rights.


2. Run the diskpart tool (for Fat32)
a. Diskpart
b. list disk (lists all connected drives)
c. select disk # (where # is the number of the drive i.e. select disk
d. clean
e. create partition primary
f.

select partition 1

g. active
h. format quick fs=fat32
i.

assign

j.

exit

3. Run the diskpart tool (for NTFS)


a. Diskpart
b. list disk (lists all connected drives)
c. select disk # (where # is the number of the drive i.e. select disk
d. clean
e. create partition primary
f.

select partition 1

g. active
h. format quick fs=ntfs
i.

assign
Page 1
Sample Manual Template

Creating a Boot USB Drive

j. exit
k. For NTFS you now need to run
i. Bootsect.exe /nt60 X: (Where X is the drive letter of the USB stick.)
ii. This file can be found on the Win7 install cd in the Boot folder.

Installing WinPE on a USB Device

Information gotten from http://4sysops.com/archives/build-a-bootablewindows-pe-3-0-usb-drive-with-rescue-tools-part-1/

1. Download Windows Automated Installation Kit (WAIK) for Windows 7.


2. After installation there will be a folder called Windows AIK on the Windows Start Menu.
3. Launch the Deployment Tools Command Prompt and enter these commands:
a. copype.cmd x86 c:\winpe_x86
b. copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
c. xcopy C:\winpe_x86\iso\*.* /e G:\ (Where G:\ is the correct drive letter.)

Adding New Tools to USB Device

Information gotten from http://4sysops.com/archives/create-a-bootablewindows-pe-3-0-usb-drive-with-rescue-tools-part-2/

Install and configure PStart


Since Windows PE doesnt have a graphical user interface like Windows, you have to launch your tools
from the command prompt, which is much too inconvenient for stressed admins. This is why I have
created this simple solution so you can easily launch your tools from a GUI. For this purpose, I will use
the free tool PStart which I reviewed a while back.
When the installation wizard of PStart asks you about the setup type, you should choose Portable
Setup (see screenshot). Select your USB drive and tell the wizard to copy PStart to the root folder.
Next, you can launch PStart from your USB drive with Windows Explorer.

Page 2
Sample Manual Template

Creating a Boot USB Drive

To try this procedure, you can copy the free file manager Q-Dir to your USB drive. I recommend
creating a special folder for all of your tools. Then, navigate to the Q-Dir folder and drag Q-Dirs exe
file to the PStart window. You should see now a new menu point (see screenshot). You can now exit
PStart.

2. Launch PStart automatically when WinPE boots up


In the next step, we have to make sure that PStart will automatically launch when you boot up
Windows PE. For this, you have to mount the wim file on your USB stick with imageX. ImageX belongs
Page 3
Sample Manual Template

Creating a Boot USB Drive

to WAIK, which you already downloaded and installed in our last session. Launch the Deployment
Tools Command Prompt from the Windows Start Menu and type:
mkdir c:\img
imagex /mountrw F:\sources\boot.wim 1 c:\img
I assume here that your USB drive has the drive letter "F:". Now launch Notepad with admin privileges
(right-click and select "Run as administrator") and then open:
c:\img\windows\system32\startnet.cmd
The problem is that the drive letter for your USB drive wont always be the same because the number
of drives in the computer may vary. The following batch script will automatically find your USB drive
and launch PStart:
@echo off
for %%p in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\PStart\ set w=%%p
%w%:\PStart\PStart.exe
Add these lines to startnet.cmd after the wpeinit command (see screenshot). I am assuming here that
you copied PStart in a folder named "\PStart" on your USB drive. Please note that PStart stores its
configuration in an XML file in the same folder.

Save startnet.cmd and then issue this command to unmount boot.wim:


imagex /unmount /commit c:\img
Thats it. You can now boot Windows PE from your USB stick. PStart should be automatically launched
and you can then run Q-Dir from PStarts GUI with just a mouse click.
3. Add your own rescue tools

Page 4
Sample Manual Template

Creating a Boot USB Drive

If you want to add additional tools, you only have to copy them to the tools folder of your USB drive
and add them to PStart by dragging their exe files to its GUI. You can do this on your Windows 7
machine like I described in my example with Q-Dir. Thus, adding a new tool to your rescue stick will
only costs you a couple of seconds once your USB drive is bootable. That is, in the future only step 3 is
required. No more messing with imageX.
Note that not every portable app works under Windows PE 3.0. Raw Copy and Barts Stuff Test 5,
which I reviewed this week, work fine. If you know of other good tools that work with Windows PE,
please post a comment below or send me a note. I have created a new category in the 4sysops list of
free administration tools for free Windows PE compatible tools.

Page 5
Sample Manual Template

You might also like