Tech Off Thread

5 posts

Windows PE **with** BOOTREC.EXE

Back to Forum: Tech Off
  • User profile image
    skunkhuffer

    Hey guys, I have been pulling out my hair trying to figure out how to build a Windows PE (or RE) disc that boots me directly to a command line console, AND has the ability to run the BOOTREC.EXE tool from the Vista install disc.  I have tinkered with many options, but I guess I'm just not getting the right recipe, because although I can execute BootRec in the PE Command line, having put it in my PE package, it does not run.  When I run "bootrec /rebuildbcd" it errors with some not able to load MUI resource(?) BS error

    I work for a large organization and fix dozens of computers a day for many retail locations.  Dell computers restore to factory using 1 WIM file, easy enough. However if these hard drives have been re-imaged at any point, after the factory restore process completes, the units will not boot Vista until I then boot a Vista Install disc, and run "Startup Recovery".

    Anybody have any advice for me how to get BootRec to run under Windows PE?  This is killing meeeee!

    Thanks in advance.

    PS:  I have verified I am running X86 versions of PE and the BootREC utility.

  • User profile image
    Cannot​Resolve​Symbol

    bootrec /rebuildbcd should just work in Windows RE, without any modification to the Vista disc.  It's one of the commands that comes built into Windows RE by default.

  • User profile image
    skunkhuffer

    CannotResolveSymbol said:
    bootrec /rebuildbcd should just work in Windows RE, without any modification to the Vista disc.  It's one of the commands that comes built into Windows RE by default.
    Yes, it does work great in Windows RE, but you must have skimmed my post.

    I need to either build a CUSTOM PE disk or figure out a way to boot RE to a command line IMMEDIATELY when the main interface loads.  PE boots me to a command line immediately, whereas RE or a Vista disk makes you use your mouse to get to a command line. Therefore, by batch file is pointless when it can't be automatically run.

    So let me summarize again.  Since PE boots to command prompt, but is lacking BOOTREC....and RE has bootrec already available, but boots to a GUI that requires interaction to get the command prompt....

    WHAT I WANT:
    A) PE Disc that can run BOOTREC stolen from RE
                   ---------- OR -----------
    B) RE Disc that pulls up a command prompt immediately

  • User profile image
    skunkhuffer

    After many hours of tinkering and Googling with absolutely no direct information on how to solve my riddle, I figured it out.

    I'm sure nobody cares because it seems there is absolutely nobody on the internet looking for this same functionality, but here's how I did it.

    1) Install the Windows AIK from Microsoft.
    2) Mount the BOOT.WIM from a Vista Installation disk.
    3) Copy ALL files (no directories) from the root of the SYSTEM32 folder in the image to a backup folder.
    4) Mount the WINPE.WIM from the AIK toolkit.
    5) Overwrite the SYSTEM32 files in the WINPE.WIM mounted image with the SYSTEM32 files from the BOOT.WIM off the Vista disk.
    (really not sure if all files are needed, but it worked nonetheless)
    6) Create a WINPESHL.INI file in the SYSTEM32 folder that will launch your custom script (I named mine AUTOEXEC.CMD, which immediately runs my script in the command line)
    6a) UNMOUNT, BACKUP THE CUSTOM WIM, THEN REMOUNT AS THE NEXT STEP CANNOT BE UNDONE AND YOUR IMAGE CANNOT BE EDITED AFTER THE FACT
    7) run the "PEIMG /PREP <mountpath>" command on the mounted WINPE image.
    8) run the "PEIMG /TARGETPATH=X:\ <mountpath>"command on the mounted WINPE image.
    9) Finally create the ISO!

    My purpose for this is to immediatly fix the BCD data with the BOOTREC utility at the end of my script.  I thank DELL specifically for whatever the heck they did to their Computer's images that makes the BCD data get corrupted after the hard drives get reimaged (with Ghost or Acronis), THEN factory restored.  Reimaging works fine, but after a reimage and a subsequent Factory Restore, the unit will NOT load Windows without running stupid Startup Repair. Really no need to boot TWO discs if one can do the job, and automated at that with ONE....

    FACTORY RESTORE.... FIX BCD DATA.... REBOOT... VOILA!!!!

  • User profile image
    SiliconChaos

    I've having the same problem for a while and finally got it to work. Here is what is needed (figured it out using Dependency Walker)

    Mount boot.wim from sources directory on the Vista DVD
    copy the following files from [Vista DVD\sources\boot.wim] to [WinPE\sources\boot.wim]
    - \windows\system32\Bootrec.exe
    - \windows\system32\wer.dll
    - \windows\system32\en-US\Bootrec.exe.mui
    - \windows\system32\en-US\wer.dll.mui

    Hope this helps...

    Robert

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.