Jump to content











Photo

Create a bootable WinPE 5.0 x64 USB drive

winpe usb wim

  • Please log in to reply
87 replies to this topic

#1 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 11 November 2013 - 01:56 PM

*
POPULAR

This tutorial will show you how to manually create a bootable WinPE 5.0 x64 USB drive. WinPE 5.0 is based on Windows 8.1.
It is very similar to my previous tutorial, but there are a few small changes to the packages.
 
I assume you are computer savvy and have at least basic knowledge regarding running commands and batch scripts.
 
By the way, there's also a much faster way to create a WinPE 5.0 USB drive, for those who have Windows 8.1 installed, using the command RecoveryDrive.exe.
We're not going to use this command in this tutorial, rather get our hands a little dirty and do it all manually.
 
*All screenshots in this tutorial are from Windows 7 SP1 x64 eng.
 
Let's begin.
 
1. First you need a PC with Windows 7 (or higher) installed on it. You obviously need a flash drive, 4GB should be enough.
 
2. You'll also need to download the ADK for Windows 8.1, or the ADK for Win10 b10586, or the ADK for Win10 b14295...and install it (the actual download is pretty large, between 2.85GB to 3.18GB).
   When installing the ADK, you'll only need to select the options I marked in this screenshot:
 

Win10_ADK_selected_options.png

 
3. Now we're going to make your flash drive bootable. Make sure it doesn't contain important files.
    From the Start Menu -> All Programs -> Windows Kits -> Windows ADK, open the Deployment and Imaging Tools Environment, and type:
    [ATTENTION: Replace ‘#’ with the DISK number of your flash drive as it appears after typing LIST DISK]

    [ATTENTION: Replace DRIVE_LETTER with the letter assigned to your USB flash drive after typing 'assign'. You can see it in Windows Explorer]
 

diskpart
list disk
select disk #
clean
create par primary
select par 1
active
format quick fs=fat32 label=WinPE5
assign
exit
bootsect /nt60 DRIVE_LETTER /mbr

Here's an example screenshot:

screenshot_13.png 

 

screenshot_155.png

 

 
4. Go to: [ADK Install DIR]\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\Media
 
5. Copy the entire "Media" folder to C:\Temp\PE5 (so now you should have C:\Temp\PE5\Media).
 
6. Copy [ADK Install DIR]\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim into: C:\Temp\PE5\Media\Sources (create this new "Sources" folder).
 
7. Rename the file you copied, from “winpe.wim” to “boot.wim“.
 
8. From the Start Menu -> All Programs -> Windows Kits -> Windows ADK, open the Deployment and Imaging Tools Environment, and type:

cd /d C:\Temp\PE5

 
9. We now need to create a new folder which will act as a mount point for the WIM file, so type:

md C:\MOUNT

10. To mount the WIM file, type:


DISM /Mount-Wim /WimFile:C:\Temp\PE5\Media\Sources\boot.wim /Index:1 /MountDir:C:\MOUNT

screenshot_14.png

 
11. We’re now going to modify the boot.wim file by inserting some optional components, which can be found here:
      [ADK INSTALL DIR]\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs
 
      Copy the "WinPE_OCs" folder to C:\Temp\PE5 (so now you should have C:\Temp\PE5\WinPE_OCs).
 
12. ATTENTION: After adding each component, we must also add its corresponding language file, otherwise the component you add won’t work!!
      I recommend adding the following components, in the order they appear:

Spoiler


 
13. Now let's see how to add some drivers to your WinPE5.0. This step is optional, so if you're doing this for the first time, you can skip it.
First, you'll need to extract the driver so that its CAT, SYS and INF files are accessible, i.e. not in ZIP file.
 
To add a (single) driver, type for example:

dism /image:C:\MOUNT /add-driver /driver:"C:\PathToDriver\drivername.inf"

     Preferably, if you have a folder containing several drivers (each in its own folder), you can add them all in one go by typing:


dism /image:C:\MOUNT /add-driver /driver:[PATH TO DRIVERS FOLDER] /Recurse /ForceUnsigned

      This will take a while depending on the quantity and size of the drivers.

 
14. At this point, prior to committing your changes and unmounting the WIM file, you can copy certain portable standalone applications (such as Process Explorer, Ghost64, etc) into C:\MOUNT so that they will reside inside the WIM file.
However, I discourage you from doing so, as there's a better way, so bare with me.
 
15. Go into C:\MOUNT\Windows\System32 and open the file StartNet.cmd with Notepad (right-click on it and select "Edit").
 
16. By default, it only contains a single line (wpeinit). Replace its contents with the following, then save the file:


wpeinit
@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:Qdir set w=%%p
call %w%:Qdir\Q-dir.exe

      The code below is based on Microsoft's own documentation; it does pretty much the same as above.
      I've tried it, and it works just as well, so use one or the other:


wpeinit
@echo off
@color 1F
:: sets bg color to blue, and text to white

wpeutil.exe WaitForRemovableStorage
wpeutil.exe UpdateBootInfo

set PEBootRamdiskSourceDrive=
for /f "tokens=1-3 delims== " %%a in ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control" /v "PEBootRamdiskSourceDrive" 2^>nul') do (
if %%a.==PEBootRamdiskSourceDrive. @set PEBootRamdiskSourceDrive=%%~dc
)
if Defined PEBootRamdiskSourceDrive (
echo PEBootRamdiskSourceDrive is %PEBootRamdiskSourceDrive%
)

@call %PEBootRamdiskSourceDrive%\QDir\Q-Dir.exe

17. ATTENTION: We’re now going to commit our changes and unmount the WIM file. Close ALL file explorers, or the unmount process will give you an error!!
      Then type the following command:


DISM /Unmount-Wim /MountDir:C:\MOUNT /Commit

When this process is finished, the C:\MOUNT folder will be empty.
 
18. It is advised to optimize the WIM file, so run the command:


DISM.exe /export-image /sourceimagefile:C:\Temp\PE5\Media\Sources\boot.wim /sourceindex:1 /destinationimagefile:C:\Temp\PE5\Media\Sources\boot_optimized.wim

   The optimized file should be a little smaller. It is safe to delete the boot.wim file, and then rename the boot_optimized.wim to boot.wim.
 
19. Now copy the contents of the folder C:\Temp\PE5\Media to your flash drive (To clarify: Copy what's inside the folder, not including the folder itself).
      The WinPE5.0 flash drive is now bootable.  :clap: 
20. Grab Q-Dir portable x64 from here, and extract the files to your bootable flash drive. Make sure the folder is named "QDir" (without the dash) and resides on the root of the drive.
 
21. Eject the flash drive, and boot from it by selecting it from the BIOS Boot Menu.
      The exact key  to get to the Boot menu depends on which motherboard you have.
      On Dell computers it's usually F12. On Gigabyte motherboards it's also F12.
      Other manufacturers use a different key to get to the boot menu. Please check yours.
      Once you are in the boot menu, you'll probably see something like this (I'm using a Gigabyte motherboard, and SanDisk flash drive):
 

Boot_Menu.jpg

 
      You can choose to boot in legacy mode, or in UEFI mode. Both should work just fine.
 
22. Once it's done loading, QDir should appear and you can pretty much do anything from here on.


Win_PE5.png

 

Troubleshooting:
Q: I've followed the guide to the letter, but my USB drive is not booting (I selected it as first boot device). What to do?
A: 1. Download BootIce from here (zip file size is only 857KB): BootIce by Pauly v1.3.3.2
     2. Extract and run BOOTICEx64.exe (or BOOTICEx86.exe if you're using a 32bit OS)
     3. Follow the steps in the following screenshot:
screenshot_136.png
     4. Try to boot again.


  • ReTokener, FoxDie, Scott Dare and 1 other like this

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13443 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 November 2013 - 02:13 PM

May I humbly suggest that since a PE 4.0 is made from Windows 8, it would be more logical to call a PE 4.1 the one made from 8.1? :unsure:

(and reserve the 5.0 to the PE that will be made from the next major version of Windows) :dubbio:

 

:cheers:

Wonko



#3 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 11 November 2013 - 02:50 PM

Wonko,

 

WinPE 5.0 is the official name.

See here: http://technet.micro...y/dn293271.aspx



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13443 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 November 2013 - 04:42 PM

Wonko,
 
WinPE 5.0 is the official name.
See here: http://technet.micro...y/dn293271.aspx

Thanks for the pointer :), a confirmation that not happy with messing only with Windows versions the good MS guys are messing also with WinPE versions.
But it's good as well, as long as the naming is consistent.

Let Windows PE 5.0 be :thumbsup:

:cheers:
Wonko

#5 Taylor Suchan

Taylor Suchan

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 11 November 2013 - 11:43 PM

I am getting a error with dism

 

Error: 3

The system cannot find the path specified.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

 

just after the mount command:

C:\>DISM /Mount-Wim /WimFile:Media\Sources\boot.wim /Index:1 /MountDir:C:\MOUNT

 

Ive confirmed all paths exsist, there is a  dism.log in the logs folder

no other error encountered.

thanks.

Taylor.



#6 Taylor Suchan

Taylor Suchan

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 12 November 2013 - 01:01 AM

I am getting a error with dism

 

Error: 3

The system cannot find the path specified.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

 

just after the mount command:

C:\>DISM /Mount-Wim /WimFile:Media\Sources\boot.wim /Index:1 /MountDir:C:\MOUNT

 

I fixed this by specifying the full path to the wim including drive letter

 

 

 

 

thanks.

Taylor.



#7 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 12 November 2013 - 06:53 AM

Hi Taylor,

I'll change the tutorial to use the full path to the WIM file.

Thanks.

 

By the way, have you succeeded in creating WinPE5.0?

Have you booted from it successfully?



#8 Taylor Suchan

Taylor Suchan

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 12 November 2013 - 07:59 PM

uhm, no it failed to boot in virtual box. 

 

i started a clean run and built it from step one with no errors then finished it up with drivers and all the suggested components then created an iso from the optimized wim using dism

however upon booting i got  ntldr is missing.

 

not sure how to proceed,

cheers

Taylor



#9 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 13 November 2013 - 07:15 AM

Have you tried booting from it directly, not in a virtual environment?



#10 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 14 November 2013 - 10:00 AM

I've added a screenshot of my WinPE5.0 x64 at the end of the tutorial.



#11 Taylor Suchan

Taylor Suchan

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 17 November 2013 - 01:01 PM

I have not gotten this build to work, out of curiosity I build a x86/64 dual booting one with the tutorial here http://www.deploymen...64-support.aspx

 

the x86 build boots for me however the x64 side does  boot correctly, so I guess I need to figure out what was different in the steps. I was thinking it was a package that was not added correctly but I checked and got no errors in either tutorials steps... I am using adk 8.1 but I have not been able to test it with the 8.0 adk....

 

I can use the x86 build for my requirements i have a dell zino and had the idea to boot it off the net work with one of those tinyPxE srvers or off of iscsi on my file server, I read an article on flat booting the PE on a hard disk, so since I got iscsi working on 2008enterprise+ software target 3.3, I have successfully   connected both Windows 8 native iscsi client and virtual box to connect and mount the volume. I worked for a company that did sales calls off a mssql auto dialing system, the users terminals were these overprices hp mini boxes running full xp, this type of pe environment would have been perfect because all the users needed was a browser to log in to log into the system to take notes and recieve calls and little else in the way of software.. I would have only required an x86 platform, Id still like to get the x64 working... I did not add any packages to the x86 pe, only a couple small portable apps in the manner you suggest avoiding, but they are tiny apps, like the pe network gui config  and bg info...

 

Id like to add a little pre-build set up tip > I used http://www.pendrivea...-driver-backup/ to create a backup of theintended target systems drivers into a structured folder that the recursive driver loading dism command works with. of course this requires that you already have a full version of windows installed to use as a source, but in my case, I do.

 Dell as it turns out provide a driver pack for thier systems, The packs of drivers are specifically for pe use. 

 

Any suggestions for the x64 pe? I am still working on it.



#12 Taylor Suchan

Taylor Suchan

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 17 November 2013 - 01:12 PM

oh. booting the x64 on a bare metal real system resulted in the "you system needs recovery" windows 8 style boot error screen, press f9 to boot another os. which lets you choose the x86 option on that dual boot pe, which worked. including all my devices including  audio, our wifi hp multi function printer scanner thing. So in either real hardware or virtual box the x64 builds in this and the deployment research tutorial do not boot correctly for me, and I cannot figure out why is that the x86 one works exactly as one would expec, yet the x64 one does not, even with no errors durring the build steps... I will post the automated batch file for this tutorial once I get it to actually work correctly repeatedly.

 

cheers,

Taylor



#13 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 17 November 2013 - 01:21 PM

Taylor,

I've no idea why your build isn't working for you.

There aren't supposed to be any problems with it.

It works both on legacy BIOS systems and the newer UEFI-based systems.

 

Please try a new build without additional packages and drivers.

Please follow my instructions thoroughly.

If it boots properly, then you can add packages and drivers.



#14 Taylor Suchan

Taylor Suchan

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 17 November 2013 - 01:33 PM

http://blogs.technet...en-updated.aspx

 

I just ran into this article... adk update, I am cleaning out all previous traces of adk and installing a freshly downloaded , updated version as well.



#15 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 19 November 2013 - 09:45 AM

Taylor,

Yes, you need to use the newly released ADK for Windows 8.1.

I think it was released sometime around October 18th, 2013.



#16 Southerner

Southerner
  • Members
  • 6 posts
  •  
    United States

Posted 19 November 2013 - 08:29 PM

May I also suggest that you do a

Dism /cleanup-wim 

before you start adding packages and get very far into creating your PE5  just in case you have any remnants of past modifications.  That will insure that you do not have any extraneous elements in your current version.



#17 Southerner

Southerner
  • Members
  • 6 posts
  •  
    United States

Posted 20 November 2013 - 07:25 PM

May I suggest that this piece of step 11 be moved between step 7 and 8:

 

 [ADK INSTALL DIR]\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs
Copy the "WinPE_OCs" folder to C:\Temp\PE5 (so now you should have C:\Temp\PE5\WinPE_OCs).
 

So that steps 8 and up get renumbered.  I think that change would make the rest of the steps flow smoother if the needed files are already there and then just get used.



#18 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 21 November 2013 - 07:14 AM

Southerner,

 

As the name suggests, these are optional components. They are not necessary for the creation of WinPE5.0.

However, they do contain files that certain apps need. I included this section in the tutorial mostly to explain to people that the option exists, so if they need a missing component (or file) - they could add it using DISM.

 

Besides, even after the creation of WinPE5.0, you can always add or remove components and drivers. It's very modular.

 

For example:

 
To mount:
DISM /Mount-Wim /WimFile:E:\Sources\boot.wim /Index:1 /MountDir:C:\MOUNT
To view installed Packages:
DISM /image:C:\MOUNT /Get-Packages
To view Features:
DISM /image:C:\MOUNT /Get-Features
To view Drivers:
DISM /image:C:\MOUNT /Get-Drivers
To add a Package (Here I'm adding the MDAC package):
DISM /image:C:\MOUNT /add-package /PackagePath:"C:\Temp\PE5\WinPE_OCs\WinPE-MDAC.cab"
DISM /image:C:\MOUNT /add-package /PackagePath:"C:\Temp\PE5\WinPE_OCs\en-us\WinPE-MDAC_en-us.cab"

To remove a Package (you need to know the package identity by viewing the installed packages):

DISM /Image:C:\MOUNT /Remove-Package /PackageName:WinPE-MDAC-Package~31bf3856ad364e35~amd64~~6.3.9600.16384
Unmount and commit changes:
DISM.exe /Unmount-Wim /MountDir:C:\MOUNT /Commit


#19 suztgf

suztgf
  • Members
  • 5 posts
  •  
    Vietnam

Posted 21 November 2013 - 12:29 PM

Dear Ericgl,

I follow all your instruction, it's OK until:

....21. Eject the flash drive....

I don't do that, and the USB not boot.

Is it (eject the flash drive) important ?

Thanks.



#20 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 21 November 2013 - 01:47 PM

suztgf,

 

Well, you can reboot without ejecting the flash drive.

But when the computer starts-up, you must press F2 / F8 / F10 / F12 / ESC to get to the boot menu.

 

The exact key depends on which motherboard you have.

On Dell computers it's usually F12.

On Gigabyte motherboards it's also F12.

Other manufacturers use a different key to get to the boot menu. Please check yours.

 

Once you are in the boot menu, you'll probably see something like this (I'm using a Gigabyte motherboard, and SanDisk flash drive):

 

Boot_Menu.jpg

 

You can choose to boot in legacy mode, or in UEFI mode. Both should work just fine.



#21 suztgf

suztgf
  • Members
  • 5 posts
  •  
    Vietnam

Posted 22 November 2013 - 03:09 AM

Thank Eric, but I don't see My USB in the boot devices list (hard drives only). Isn't it bootable?

One more question:

...19. Now copy the contents of the folder C:\Temp\PE5\Media to your flash drive..

Shall I copy all of the the contents only, or the whole folder?

I'll try more today.



#22 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 22 November 2013 - 07:43 AM

suztgf,

 

Copy what's inside the folder, without the folder itself.



#23 suztgf

suztgf
  • Members
  • 5 posts
  •  
    Vietnam

Posted 22 November 2013 - 08:02 AM

Hi Eric,

At last it works on my Asus R500A, but still not work on my desktop Gigabyte P5S3L. Perhaps Bios is too old.

I try to add some drivers and application.

Thanks for guiding.



#24 suztgf

suztgf
  • Members
  • 5 posts
  •  
    Vietnam

Posted 22 November 2013 - 08:08 AM

One more question, Eric:

How can I transfer that into a ISO file, for booting from CD?



#25 ericgl

ericgl

    Frequent Member

  • Expert
  • 314 posts
  •  
    Israel

Posted 22 November 2013 - 12:23 PM

suztgf,

 

I don't use CDs anymore, so I haven't tested this.

Use the following instructions at your own risk:

 

1. Attach your WinPE5.0 flash drive to the PC, and note the drive letter it received. Let's assume it's F:

2. From the Start Menu -> All Programs -> Windows Kits -> Windows ADK, open the Deployment and Imaging Tools Environment, and type:

F:
F:\> oscdimg.exe -b"etfsboot.com" -n -h Media C:\Temp\WinPE5x64.iso

If all goes well, the ISO file should be created in C:\Temp.

Then you burn it to a CD, and boot from it.

 

In any case, before you do anything, read this first:

http://technet.micro...3(v=ws.10).aspx







Also tagged with one or more of these keywords: winpe, usb, wim

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users