WinPE 5.0 GUI

In one of mine previous blogs, Creating a WinPE 5.x boot image with PowerShell, I’ve promised that I would provide more info about GUI that I’ve build for WinPE. You can read my post abut using WinPE GUI in order to create Dual Boot External USB Drive. But this time I’ve decided to build an interface for WinPE using Microsoft PowerShell in addition to an HTA application built in VBScript (ACBWinPEx64.hta and ACBWinPEx64.hta are included as well).

This interface is used in my blog about WinRE 10 with wireless support:

1. www.alexcomputerbubble.com/wireless-support-winre-10-part-two
2. www.alexcomputerbubble.com/wireless-support-winre-10-part-one

 

If you had a chance to read my blog about creating WinPE 5.0, you learned that I like to have a folder that will house and keep organized all my WinPE drivers, applications and configuration files. See the picture below that provides some info about the content of my WinPE-Plugin folder.

ACB_WinPEpluging

WinPE-Plugin folder has two subfolders Apps and Drivers that house 64 bit and 32 bit applications and drivers. Amd64 folder, for example contains all files and apps that I need in order to build my customized 64 bit WinPE.

WinPEx64BitFolderStructure

This is the list of applications included here:

  1. DevManView v1.41, http://www.nirsoft.net/utils/device_manager_view.html
  2. DriverView v1.46, http://www.nirsoft.net/utils/driverview.html
  3. ProduKey v1.66, http://www.nirsoft.net/utils/product_cd_key_viewer.html
  4. SearchMyFiles v2.48, http://www.nirsoft.net/utils/search_my_files.html
  5. NTPWEdit version 0.4 GPL, http://cdslow.webhost.ru/en/ntpwedit/
  6. PE Network Manager by Holger Kotsch, http://holger.reboot.pro/
  7. GImageX v2.1.0, http://www.autoitconsulting.com
  8. HWiNFO, http://www.hwinfo.com/
  9. Pale Moon Portable, http://www.palemoon.org/palemoon-portable.shtml
  10. Notepad2, http://notepad2.com/
  11. Explorer++ 1.3.5, https://explorerplusplus.com/download

Please note that you should always visit the home page for each listed application and download the latest version by yourself from its developer site. In addition, note that a small utility named ProduKey from www.nirsot.net some Antivirus scanners report as infected with a Virus or Trojan, even when the program is not really infected with any malicious code. This kind of problem is known as “False Positive” or “False Alert”, and it’s quite a common problem in some of the password recovery tools provided in NirSoft Web site.

One very important file, named startnet.cmd is responsible for running start-up scripts when WinPE first runs, and its content look like the following:

ACB_WinPE_startnet

As you can see from the file’s content, it initializes the network settings, disables firewall, runs unattend file to set resolution and at the very end starts PowerShell GUI application named: ACB-WinPEx64.ps1 (note that for 32 bit architecture the name of GUI application is ACB-WinPEx32.ps1). I want to start interface in PowerShell, and my HTA application in the batch file is behind the REM command. If you want to use HTA application, please just remove comment in front of HTA application and paste it in front of line that starts PowerShell script.

WinPE – PowerShell GUI

This application has three tabs: Computer Info, Network and Applications. On all tabs there is an image, named “Gears” that I like very much so I had to stick it on all the three tabs. This image is from the portfolio of “Master isolated images“. It is acourtesy of Master isolated images and obtainedfrom site: www.freedigitalphotos.net.

The first tab, The Computer Info, displays info about computer’s hardware (make, model, serial, NIC, etc.) and the drives. By clicking on View Drivers button, you can list all the drivers loaded in WinPE session. From this tab, just like all the others, you can use buttons to start CMD command, restart or shutdown a computer.

WinPEone

The second tab, Network, displays WinPE drives and drives mapped during WinPE session. You can use Network Manager to refine network settings and NIC. In addition you could use WinPE network connection to map additional drives (for example a share that contains .Wim files). WinPE-Plugin\Drivers folder contains two subfolders (amd64 and x86) with a few NIC .inf files. In the case that your computer has a NIC that is not available here, you will have to add the .inf files into a folder appropriate for your computer’s architecture.

WinPEtwo The third tab, Applications, lists all the applications and additional scripts that you can use with this WinPE. For example, you would first map a drive K: to a folder containing images (\\MyServer\Images) on the second tab, and then you would come here, click on the button named “DiskPart GUI Tool” to format computer’s hard drive in accordance with one of the Microsoft recommended disk partition structure, and finally, “Run ImageX GUI Tool” button and use GimageX tool and apply .wim image file located in the mapped folder. Microsoft ImageX utility is uploaded in the same folder (X:\Windows\System32\GimageX), and you can always start CMD and use this tool to either capture or apply .wim images.

WinPEthree

All applications used here are portable executables capable of running under both amd64 and x86 architecture. The DiskPart GUI Tool is a scripted utility, and the idea for this GUI tool I’ve found by reading about a utility to format disk, posted by Daniel Ratliff – http://www.potentengineer.com/powershell-osd-frontend-with-windows-forms/.

ACB_WinPE_DiskPart

The utility has two panes, on the left it displays physical disk and on the right lists the BIOS/UEFI partitions’ structure as recommended by Microsoft guides. To partition and format a disk on your computer, please first select partition option, then the physical disk and finally execute the action by clicking on “Format Disk” button. The DiskPart tool formats selected physical disk based on the content of the PowerShell here-string as shown in the example below.

ACB_WinPE_PartitionsStructure

What about HTA – WinPE 5.0

Some of you out there still like VBScript and HTA applications and choose HTA instead of PowerShell GUI apps. I have included both ACBWinPE.hta applications for both 32 bit and 64 bit systems.

This is the main page:

HTA_main

And this is the page where you launch most of the applications:

HTA_Apps

You have to discover the rest by yourself (it is included in the download file WinPE-Plugin.zip).

How to have this WinPE 5.0 GUI installed

  • You need to have Windows ADK 8.1 installed; download the Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 Update here: http://www.microsoft.com/en-us/download/details.aspx?id=39982.
  • Download WinPE-Plugin.zip package from the download section, under Application folder; this download has been divided into three portions/compressed files. You need to download all three files and do the following:

1) unzip the main folder: WinPE-Plugin (for example C:\WinPE-Plugin)
2) unzip the folder WinPE-Plugin_x64_PartTwo
3) find amd64 folder inside WinPE-Plugin_x64_PartTwo\Apps and copy/paste it into  C:\WinPE-Plugin\Apps folder
4) find amd64 folder inside WinPE-Plugin_x64_PartTwo\Drivers and copy/paste it into C:\WinPE-Plugin\Drivers folder
5) unzip the folder WinPE-Plugin_x32_PartThree
6) find x86 folder inside WinPE-Plugin_x32_PartThree\Apps and copy/paste it into C:\WinPE-Plugin\Apps folder
7) find x86 folder inside WinPE-Plugin_x32_PartThree\Drivers and copy/paste it into C:\WinPE-Plugin\Drivers folder

  • Run as administrator the PowerShell script named DualBoot-WinPE50.ps1; it creates under WinPE-Plugin folder four subfolders: Media, Mount, WinPE50_amd64 and WinPE50_x64. See the picture here: WinPE-PluginFolderAfter
  • Use my DiskPart application (you could find it in the download section) to build a bootable USB stick. It will format a USB drive and transfer all files from the following folder: C:\WinPE-Plugin\Media to the USB drive.

If you do not need to create a WinPE that dual boots (both 32 and 64 bit architecture), just edit the last lines in DualBoot-WinPE50.ps1 script and create either 32 bit WinPE bootable disk:32Bit

or a 64 bit WinPE bootable disk:64Bit

At the end, you can always expand this WinPE GUI with additional applications that you find useful in your environment. I do believe that ACB-WinPE.ps1 is a solid foundation that you can use to build upon. There are plenty of 32 bit portable applications that are not included here, but someone could find them very useful (apps like image viewer, virus scanner, etc.). Unfortunately we do not have that many 64 bit applications available for WinPE. If you find some that could be very useful to others, please post your comments here.




 

Please note: Although the author has made every reasonable attempt to achieve complete accuracy of the content, he assumes no responsibility for errors or omissions. Also, you should use this information as you see fit, and at your own risk.

 

33 thoughts on “WinPE 5.0 GUI

    1. admin Post author

      I loved the idea to use PowerShell here-string, pipe it into DiskPart command and output the result into the RichTexBox so much that I had to implement it here.

      Reply
  1. Goro

    Hello,

    hello,

    is it possible to convert these commands in powershell for me please because i would like integrate the script for keyboard and language french
    Thanks a lot

    # Add French keyboard an lang
    & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\lp.cab
    & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-UILang:fr-FR
    & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-SysLocale:fr-FR
    & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-UserLocale:fr-FR
    & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-InputLocale:fr-FR

    Reply
    1. admin Post author

      I have used the code below without any errors:

      # Add WinPE 5.0 optional components using ADK 8.1 version of dism.exe
      # Default Input Locales for Windows Language Packs: https://technet.microsoft.com/en-ca/library/hh825684.aspx
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\lp.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-UILang:fr-FR
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-SysLocale:fr-FR
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-UserLocale:fr-FR
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Set-InputLocale:040C:0000040c
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\WinPE-Scripting.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\WinPE-Scripting_fr-fr.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\WinPE-WMI.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\WinPE-WMI_fr-fr.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\WinPE-MDAC.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\WinPE-MDAC_fr-fr.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\WinPE-NetFx.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\WinPE-NetFx_fr-fr.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\WinPE-PowerShell.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\WinPE-PowerShell_fr-fr.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\WinPE-DismCmdlets.cab
      & $DISM_Path\dism.exe /Image:$WinPE_MountFolder /Add-Package /PackagePath:$WinPE_OCs_Path\fr-fr\WinPE-DismCmdlets_fr-fr.cab

      Cheers.

      Reply
  2. RobH

    Thank you for putting all of this together. I’ve been working the past 4 days to customize all of this to my environment. I’m trying to make a tool for our desktop technicians. One thing has me absolutely stumped, though:
    I need to run a command to perform a DoD wipe on a drive. I’m using GDisk64.exe. I built a form based on your DiskPart form. I can use something like
    $command = “x:\Windows\System32\GDisk64.exe $DriveNumber /WIPEDRIVE /DODWIPE /Y”
    Invoke-Expression $command
    But that runs it in the cmd window in the background. I need it to either run in the foreground (i.e. in a new Command window, or display in the RichTextBox in the form (preferable).

    Any help would be great. Thanks again for all the work you put into this.

    Reply
    1. admin Post author

      Check these examples on how to start process in new command line window, and they will help you resolve your problem:
      First Example:
      Function do_TestPing{
      $commandTestPing = @”
      Start-Process ping -ArgumentList 192.168.2.1, -t |Get-Process
      “@
      Invoke-Expression $commandTestPing
      }
      do_TestPing

      Second Example:

      Push-Location -Path C:\WinPE-Plugin-BOA\Apps\amd64\GImageX
      Start-Process imagex.exe -ArgumentLIst “/capture C: G:\Images\I.wim “”IWim”” ”
      $id = (Get-Process | Where -FilterScript {$_.ProcessName -eq “imagex”} |Select -Property $_.Id).id
      $id

      Reply
  3. Ryan

    Hello! I love the work your doing and we are excited about the potential of this program in our shop. However, i cannot get it to boot. I follow all the steps, then use your guide to create an ISO to burn to dvd, but whenever i boot from it i get the windows 8 BSOD with an error code 0xc0000000f. I dont have any usb drives to test it right now but i will try that soon. Any ideas? I will work on it in the mean time.

    Reply
    1. admin Post author

      Your problem could be triggered by your BIOS UEFI and SATA compatibility (boot UEFI windows 8).
      Some people have to disable Fast UEFI secure boot from the BIOS.You could try to change Boot Mode from UEFI to CSM mode,
      and maybe to change SATA Controller mode and make it Compatibility mode.

      Reply
      1. Ryan

        I checked those settings in the bios, it seems CSM mode was already active, SATA Compatibility mode also. Wierd thing is, we used the .wim file to load through a PXE boot method and it worked perfectly! It seems the image itself wasnt the issue but the ISO. Either way, a network boot was our endgame anyway so mission accomplished! Thank you for your hard work!

        Reply
    1. admin Post author

      The winPEResolution.xml contains info to configure horizontal and vertical resolution for WinPE, as follows:
      settings pass=”windowsPE”
      ColorDepth = 32
      HorizontalResolution = 1024
      RefreshRate = 60
      VerticalResolution = 768

      The startnet.cmd file triggers / configures this resolution by the following line:
      wpeinit.exe /unattend=X:\Windows\System32\WinPEResolution.xml

      Reply
  4. morry davis

    I have one small problem. After I create a boot USB from bootiso for amd64 it doesn’t seem to recognize anything connected to ethernet port because It has no IP address when booted up in PE

    Reply
  5. morry davis

    This was all working fine for me but now by PE USB wont boot. I get Error 0xc0000017 not enough memory to build ram disk device and I don’t know how to fix it? Please Help

    Reply
    1. admin Post author

      Check this link and see if this applies to your case: https://support.microsoft.com/en-us/kb/2209360
      The scratch space in WinPE 5.0 is used as a temporary storage for log files etc. and is by default stored in RAM, even though you can change that. In earlier WinPE versions you set it higher than the default 32 MB, but a typically value is 128 MB. In WinPE 5.0 there is no need to do that anymore, and the scratchspace size is set dynamically, meaning most times it doesn’t really matter what you set, WinPE will change it during boot anyway.
      The value is depending on the amount of RAM in your machine.If you have 512 MB of RAM, WinPE 5.0 won’t even boot, and fail with: status 0xc0000017 There isn’t enough memory available to create a ramdisk drive.

      Reply
  6. morry davis

    Could it be I tried installing all the drivers for the particular Hardware (Lenovo P50)
    If I remove the Drivers folder from the WinPE-Plugin folder it works fine. So, what is the minimum
    Set of drivers I should install?

    Reply
    1. admin Post author

      Install only drivers that are necessary for the particular hardware, for example a driver for computer’s NIC.

      Reply
  7. Pingback: CustPE : Installer vos propres outils dans WinPE | Déploiement MDT - WDS | IT-Connect

  8. Jonas

    My computer does not give me the option to run the DualBoot-WinPE50.ps1 file as administrator. It does give me the option when I right-click on other executable files tho. I ran it without admin rights so only the three subfolders: Mount, WinPE50_amd64 and WinPE50_x64 were added. Is the Media folder crucial to the process? Or do you might have a solution? Thank you in advance, Jonas

    Reply
    1. admin Post author

      You have to open an elevated PowerShell prompt first; find it on you Start menu or in the task-bar search, type PowerShell. Now see the result Windows PowerShell which appears on the top. Right-click on it and select Run as Administrator. Once you have PowerShell open, then type in there the location of the DualBoot-WinPE50.ps1 file and run it.

      Reply
      1. Berryman

        open power shell under run as, and select administator, type Set-ExecutionPolicy Unrestricted
        now run your script by typing ./the script name if local and .\ if in other folder

        Reply
  9. Dikshant Patel

    How is the compatibility of the code with ADK 10? I noticed in code there are paths for the default install locations of 8.1 which I can investigate and change to ADK 10 paths.

    Or is there anything else hidden in code that I need to be wary about?

    I am trying to make a package for WinPE 5 using ADK 10 on a Windows 10 64 bit Machine and only for 64 bit image only.

    Reply
      1. Dikshant Patel

        Was able to run the DualBoot-WinPE50.ps1 after a few trial and errors. I had edited it out to not run the x86 part since I need only 64 Bit.

        Ran the Create-DualBootExternalUSBDrive.ps1 since I was just testing to see if it will work. It did all it was supposed to but the when I tried to boot from the drive on a device. It did not go anywhere.

        Should I try to instead create a 64 bit boot drive instead of Dual Boot?

        Reply
  10. Pingback: CustPE : Installer vos propres outils dans WinPE | Déploiement MDT - WDS | IT-Connect

Leave a Reply

Your email address will not be published. Required fields are marked *