You are here:   Research
Register   |  Login
The quickest way to find articles is to use the below search option.

However, if you go to the end of this page, you also find the Blog archive (calendar format) that allows for browsing of older articles.

Search:

Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Sep 14

Written by:
9/14/2011 9:39 AM  RssIcon

Here is a step-by-step guide to create a x64 bootimage with support for Scripting, WMI, HTA, ADO, .NET Framework 4.0, PowerShell and the DISM cmdlets for PowerShell.

Create the boot image

In this sample you will create a x64 boot image.


  1. Download the Assessment and Deployment Kit (ADK) from MSDN subscribers download

  2. Install ADK by running adksetup.exe, and make sure that Windows Preinstallation Environment is selected (selected by default)

  3. Create the C:\WinPE_x64 folder

  4. Copy the winpe.wim file from C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64 to C:\WinPE_x64

  5. Create the C:\Mount folder

  6. Start the Deployment Tools and Imaging Environment, and mount the boot image using the following command:

    Imagex /mountrw C:\WinPE_x64\winpe.wim 1 C:\Mount

  7. Add the various optional components to the boot image by running the following commands:

    cd /d "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"

    dism /image:C:\Mount /add-package /packagepath:"WinPE-Scripting.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-Scripting_en-us.cab"


    dism /image:C:\Mount /add-package /packagepath:"WinPE-WMI.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-WMI_en-us.cab"


    dism /image:C:\Mount /add-package /packagepath:"WinPE-MDAC.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-MDAC_en-us.cab"


    dism /image:C:\Mount /add-package /packagepath:"WinPE-HTA.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-HTA_en-us.cab"


    dism /image:C:\Mount /add-package /packagepath:"WinPE-NetFx4.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-NetFx4_en-us.cab"


    dism /image:C:\Mount /add-package /packagepath:"WinPE-PowerShell3.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-PowerShell3_en-us.cab"


    dism /image:C:\Mount /add-package /packagepath:"WinPE-DismCmdlets.cab"

    dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-DismCmdlets_en-us.cab"
     

  8. Commit the changes to the boot image by running the following command:

    Imagex /unmount /commit C:\Mount

  9. Done, you now have 280 MB or so boot image, that you can add to your WDS (PXE) server.

Optional step - create a bootable ISO image.

If you don't have a PXE server or just want to mount an ISO for test, here you find the additional steps to create a bootable ISO.

  1. Create the C:\WinPE_x64\ISO folder

  2. Copy the contents of the C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\Media folder to C:\WinPE_x64\ISO

  3. Create the C:\WinPE_x64\ISO\Sources folder

  4. copy (or move) the winpe.wim file in C:\WinPE_x64 to C:\WinPE_x64\ISO\Sources

  5. Rename the winpe.wim file in C:\WinPE_x64\ISO\Sources to boot.wim

  6. Copy the etfsboot.com file from C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment and Imaging Tools\amd64\Oscdimg to C:\WinPE_x64

  7. Create the bootable ISO by running the following command:

    oscdimg -b"c:\WinPE_X64\etfsboot.com" -n C:\WinPE_X64\ISO C:\WinPE_X64\WinPE_X64.iso

  8. Done, you now have a 330 MB or so ISO.




The PowerShell command window in WinPE - Listing some hardware info using WMI.


/ Johan

 

23 comment(s) so far...


Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

When will this be available for technet subscribers?
Or more widely available for that matter?

By dot45 on   9/15/2011 1:19 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

I have asked the setup team at Microsoft but no info yet, sorry.

/ Johan

By Arwidmark on   9/15/2011 8:43 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

I'm excited about the .Net framework support here. Do you know if this can be used used to deploy Win7? My guess is yes. Also, do you know if the WinPE-NetFx4_en-us.cab file would work on a WAIK 3.0 WinPE setup? Just curious. I don't know if we would start using the ADK if it hasn't been through the ringer fully yet.

Thanks for posting this. I haven't found this information any where else yet.

By yarbizzle on   9/16/2011 11:01 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Ehhh Cannot find it in my MSDN subscription either MSDN AA or technet :( I'm so keen to do some testing using powershell in Windows PE. It would open so many new abilities of deploying OS and customizing them :)

By rpieniaz on   9/16/2011 12:42 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Hi Johan!
Thank you for the infomation sharing, I really need .Net support in WinPE, I will check it out soon :)

By Naveed on   9/17/2011 1:02 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

I made a x86 version of the above - booting from cd is fine and runs my .net4 apps woohoo - but i tried adding the boot.wim to a WDS server (on a win server 2003 box) - it broke WDS and you could no longer network boot.. had to re-store E:\RemoteInstall\Boot from last backup to get WDS to run again... - I really want this running from WDS!

By h3mp on   10/3/2011 6:05 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Wow, I have never tested WinPE 4.0 on Windows Server 2003... I stopped using 2003 as WDS servers almost four years ago...

/ Johan

By Arwidmark on   10/3/2011 12:28 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

I followed the (excellent) instructions for configuring WinPE with all the packages indicated. WinPE runs fine and executes Win32 programs, but not a simple ("Hello world") .NET 4.0 GUI app. Did I do something wrong in configuration or is there some kind of limit on the kind of .NET 4.0 support?

By Kevin King on   1/13/2012 5:39 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Hi Kevin,

I tested to write a small Windows Forms Application in C$ (.NET Framework 4 client profile), and that worked fine in WinPE. I have uploaded my sample to this link if you want to try it in your boot image. www.deploymentresearch.com/DRFiles/DotNetSampleAppWinPE40Demo.zip (Please note it's a x86 app).

If you want me to test your code, please zip the project and upload your code somewhere and post the link.

/ Johan

By Arwidmark on   1/17/2012 4:32 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Thanks. I executed the procedure again and it works, so I did something wrong the first time. The 32-bit sample didn't run, maybe because WinPE still doesn't support WOW64, but an x64 app .NET app worked fine.

By Servant on   1/18/2012 12:58 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

What's the different between WAIK and ADK?

I expect that Microsoft will release a new WAIK for handling Windows Server 8 automated installation. Is that a realistic expectation? ;-) or ADK is the NEW way to go.

By NicholasAdrian on   5/1/2012 6:01 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

ADK is the next release of WAIK. ADK will be used for both Windows 8 and Windows Server 2012 deployments, and will be released at the same time.

/ Johan

By Arwidmark on   5/4/2012 10:47 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Hi All,

Does anyone knows if SRT package is available for Winpe 4.0 /ADK? I couldn't found it.
Is the recovery package has been moved or renamed or not present at all?

By Naveed on   6/17/2012 12:01 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

ADK is simply the next version of WAIK. ADK is not required for Windows 8 or Windows Server 2012 deployments, you can still use WAIK, but does include additional features that are useful.

/ Johan

By Arwidmark on   6/17/2012 9:39 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

I don't now for sure about the SRT package, but I expect Microsoft to continue to only include it in the setup boot.wim, and not in the generally available ADK. Like it is for WinPE 3.0

/ Johan

By Arwidmark on   6/17/2012 9:50 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

I understand that they disabled the 8.3 naming convention in ADK and did not include the fsutil.exe in WinPE 4.0.
this is causing applications that use this naming convention to fail.. Are there any plans to add the fsutil.exe back into PE 4.0 or enable the 8.3 naming convention?

By zdm0293 on   7/8/2013 7:04 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Don't know if it will be added in WinPE 5.0, but there are ways to fix this in WinPE 4.0

social.technet.microsoft.com/Forums/en-US/18aea633-de1d-4935-a748-320abc01746d/enable-8dot3name-in-a-task-sequence-using-winpe-40

/ Johan

By Arwidmark on   7/9/2013 5:10 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Hi! Same build but with PE 8.1..

---------------------
# Run the Imaging tools command prompt as Administrator:
C:\Windows\system32\cmd.exe /k "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat "

# Run the following commands or save them as a cmd and run it in the Imaging tools command prompt!

md c:\mount
md C:\WinPE_x64

copy "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim" c:\WinPE_x64

Imagex /mountrw C:\WinPE_x64\winpe.wim 1 C:\Mount

cd /d "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"

dism /image:C:\Mount /add-package /packagepath:"WinPE-Scripting.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-Scripting_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-WMI.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-WMI_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-MDAC.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-MDAC_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-HTA.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-HTA_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-NetFx.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-NetFx_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-PowerShell.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-PowerShell_en-us.cab"
dism /image:C:\Mount /add-package /packagepath:"WinPE-DismCmdlets.cab"
dism /image:C:\Mount /add-package /packagepath:"en-us\WinPE-DismCmdlets_en-us.cab"

Imagex /unmount /commit C:\Mount

cd\
copype amd64 C:\WinPE_x64\bootiso
copy C:\WinPE_x64\winpe.wim C:\WinPE_x64\bootiso\media\sources\boot.wim /Y
MakeWinPEMedia /ISO /f C:\WinPE_x64\bootiso C:\WinPE_x64\WinPE_x64.iso

----------------------

By samohtrelhe on   11/26/2013 2:56 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Cool, thanks for the update.

Do you mind if I create a new post with that info? (will give you credit of course)

/ Johan

By Arwidmark on   11/27/2013 4:05 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

REPLY TO: "/ Johan"

is there any chance you could share your code for that .exe? Where I work I could very possibly use this but due to your typical in-house restrictions something like this running in a production environment would have to be approved and live in our source.

thanks
Sean

By magill on   3/14/2014 12:30 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Hi Magill,

What .exe?

All commands I'm using is part of Windows ADK which is a free download from Microsoft. No source code is available.

/ Johan

By Arwidmark on   3/16/2014 6:01 AM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

Hi Johan,

I am new to this on building WinPE on Windows 8 and i'm following your steps.

When I issue this command:
Imagex /mountrw C:\WinPE_x64\winpe.wim 1 C:\Mount

I get a message:
'imagex' is not recognized as an internal or external command,
operable program or batch file.

Please help.

By Renfel on   9/21/2014 7:52 PM
Gravatar

Re: Windows 8 Preview - Howto - Creating a WinPE boot image with .NET Framework and PowerShell

You need to have Windows ADK 8.1 installed, and open a "Deployment and Imaging Tools Environment" command prompt that sets the path to the tools.


/ Johan

By Arwidmark on   9/25/2014 12:50 AM