Update: There is now an easier way to create Windows PE boot media and add your own rescue tools.

In my last post, I explained how you can create a bootable USB drive with Windows PE 3.0. Today, I will show you how to add your own tools to your USB drive and launch them conveniently after you boot Windows PE.

Most descriptions on the web will recommend mounting the wim file with imageX and then copying your tools to the Windows PE installation before creating your boot media. Although this makes sense for a rescue DVD, I wouldn't recommend this procedure for a thumb drive. It is just too cumbersome to create your Windows PE installation from scratch whenever you want to add a new tool.

Windows PE PStart

Windows PE automatically mounts your USB drive. Therefore, you can simply copy all your tools to your thumb drive in a separate folder that is independent from Windows PE. Its advantage is that you can update your tools or add new ones without starting from scratch every time. However, with this procedure, you always have to find the drive letter of your USB stick first, and then navigate to the tool you want to launch on the command prompt. Real Windows geeks want more convenience.

In the following three steps, you will learn how to configure your bootable USB drive with your own rescue tools. Steps 1 and 2 have to be performed only once. Step 3 is for adding new tools to your USB drive and has to be followed every time you add new tools.

1. Install and configure PStart ^

Since Windows PE doesn't 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.

PStart Setup

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-Dir's exe file to the PStart window. You should see now a new menu point (see screenshot). You can now exit PStart.

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 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 won't 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.

Windows-PE-Rescue-startnet.cmd

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

imagex /unmount /commit c:\img

That's it. You can now boot Windows PE from your USB stick. PStart should be automatically launched and you can then run Q-Dir from PStart's GUI with just a mouse click.

3. Add your own rescue tools ^

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 Bart's 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.

123 Comments
  1. Fred 13 years ago

    Thanx for this part2, I will try this weekend !

  2. Great. Please let me know if it worked.

  3. Mikael Karlsson 13 years ago

    You should definitely have a look at RocketDock. It’s just as simple to configure but unlike PStart it looks really good as well.

    http://rocketdock.com/

  4. Thanks for the tip Mikael! It is on my to-do list. Does it also run on Windows PE?

  5. Mikael Karlsson 13 years ago

    Hi Michael,
    Rocketdock runs just fine on WinPE, I’ve been using it for about a year with no problems.
    I does however use a lot of sceenspace width-wise. I use a utility called “setres” to increase the resolution of the screen. I does not support wide screen monitors however, probably because there were no such around back in 2005…
    Does anybody know of a better app???

    Setres is freeware and can be downloaded from http://www.softpedia.com/get/Multimedia/Video/Other-VIDEO-Tools/SetRes.shtml

  6. Pettson 13 years ago

    Don’t know if it’s what your looking for, or will work in WinPe but the old app “Size-o-matic” is standalone and supports custom windows sizes. If I just could get my WinPE usb to boot so I can try it… Something is going wrong with my usb drive?

  7. Mikael, perhaps adding your video card driver to WinPE will help?

    Pettson, what exactly doesn’t work? Did you check if USB boot is enabled in your BIOS? You also have to make sure that the USB drive is configured as the first boot drive in the BIOS.

  8. Pettson 13 years ago

    WinPe is booting, then wpeinit command starting. After that I got “‘e’is not recognized as an internal or external command, operable program or batch file”.
    I have follow the steps you wrote, twice on 2 diffrent pc’s, 2 usb drives and 2 WAIK installs. Only diffference is on first usb drive it says ‘x’ and second ‘e’? It must be device letters, e and x but for/from what?

  9. This sounds as if something went wrong when you copied the batch script. Please make sure that you only added two lines to startnet.cmd. The first one ends with “set w=%%p” and the second starts with “w=%%p”. It is also possible that you are using a different folder name for PStart. There has to be a folder in the root directory of your USB drive named “PStart”, otherwise the batch script can’t find the location of PStart. You also have to ensure that there are no other drives with such a folder in the root directory.

  10. Pettson 13 years ago

    Got it! Found hiden spaces in your startnet.cmd lines Michael. Did a imagex re-mount on both usb drives and wrote the startnet.cmd lines by hand and now it works.

    Now it’s time to see what tools that could be used, first to try is Foxit Reader, Express burn and Recuva. 🙂

  11. Congrats! A good place to start looking for WinPE tools is here. Let me know if you found new tools that work on WinPE 3.0.

  12. Pettson 13 years ago

    http://www.snapfiles.com/features/ed_usb_software.html and http://www.pendriveapps.com have a nice list too

    A starter and here to.

    InfraRecorder
    WinRAR unplugged (shareware)
    TreeSize (Copy installation folder)
    Defraggler
    Disk to VHD (SysInternals)
    Recuva (Skip the wizard)

    All above are working for me.

    HWiNFO32, SiW and CDBurnerXP are some of the software I did try and fail with, but i have read that they “should” work as standalone.
    It will take some time to fill a 2GB stick with working and useful software that will come in handy both at work and private. 😉

  13. Pettson 13 years ago

    oh, my links did’nt worked out as ment..:|

  14. Pettson, thanks a lot! This is interesting information! I corrected the links.

  15. Travis 13 years ago

    https://www.sit.auckland.ac.nz/Create_a_custom_boot_image

    I really like this shell, it’s basic but does the job and looks familiar.

    http://explorerplusplus.com/

  16. Dave 13 years ago

    I had the same issue with the blank spaces. Thanks Pettson, you probably saved me some valuable time from searching back through everything I did.

  17. Steve 12 years ago

    Hi Michael,

    This tutorial was excellent, and it allowed us to make a really nice bootable USB utility flash drive.

    Some computers here can’t boot from USB, and I was wondering if you knew of a way to do the same thing using a CD/DVD?

    I suspect you are a busy guy bombarded with e-mails all day long. If you’d be so kind as to assist us, I’d be happy to send you a Lehigh University shirt or something else from our spirit shop. Just let me know your size.

    Thanks,
    Steve

  18. Thanks Steve. The problem with the DVD solution is that you have to build a new Windows installation every time you want to add a new tool. If you really still need DVDs, I recommend using UBCD. There are also two new projects that are based on Windows PE 3.0. And thanks for the shirt, but I am a digital nomad and my bag is already full. 😉

  19. Tshaka 12 years ago

    I did the last part of your intsructions but when I boot from the flash I get a error message.
    ‘f’ is not recognized as an internal or external command, operable program or batch file.

    Can you tell me what I did wrong Thanks.

  20. Brian 12 years ago

    Hi Michael:

    I need some help here. When I try imagex /mountrw F:\sources\boot.wim 1 c:\img i get the following error
    error mounting image

    A required privilege is not held by the client.

    I ran the depoly tool camand promt as Admin but still get that error

  21. Brian, maybe no write privileges on the folder? What happens if you mount the image for read? You could also try a different folder.

  22. David Tonks 12 years ago

    Greetings Michael,
    Like steve on June 14 I attempted to use your script on a cd version of 7 PE and get the same error ‘e’ not recognised etc.

    I created my PE from win 7 ultimate (fully updated) using win 7 AIK

    I have made the alterations as administrator to startnet.cmd three times always the same result.

    I used Ultra ISO to add the Tools and PStart folders to the root of the CD, easier than imagex!!

    Any help you could give would be wondeful.

    David Tonks

  23. SY 12 years ago

    Hi Michael,

    I was following your steps by steps.
    Everything is doing well.
    Only Q Dir isn’t working.
    OS I’m using is windows 7 Home Prem 64bits
    I’ve try to download all the version of Q Dir but none of them would start up and prom me an error message.

    Appreciate if you could help me solve my this small little problem

    Thanks alot

  24. Ralf 12 years ago

    Hello Michael

    Thanks a lot for your short and easy description.

    I am writing because I get an error with the script you use for finding the USB drive letter. It has problems with checking my floppy disc drive without a floppy in it.

    I have written my own workaround and want to give it to you.

    The drive letter of the USB disc you are booting from is written in the registry under HKLM\SYSTEM\CurrentControlSet\Control with the name PEBootRamdiskSourceDrive. I use this information for starting the PStart.exe. Here is my script (all in one line):

    for /f “eol=! tokens=3” %%d in (‘reg query hklm\system\currentcontrolset\control /v PEBootRamdiskSourceDrive’) do %%dPStart.exe

    Greetings from Germany

    Ralf

  25. Gregory 12 years ago

    I have this all setup and have created several ghost images that I am applying. What I would like to be able to do is somehow play a sound when the ghost images has been applied. What do I need to enable to get sound working (sound card or pc speaker)??

    Thanks

Leave a reply

Please enclose code in pre tags

Your email address will not be published.

*

© 4sysops 2006 - 2022

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account