Does WINRE Custom Tool support HTA?


  • I setup WINRE customization according to the following;

    Instead of an exe i'm using an hta file. As such the winreconfig.xml looks like this.

    <?xml version="1.0" encoding="utf-8"?> <!-- WinREConfig.xml --> <Recovery> <RecoveryTools> <RelativeFilePath>tool.hta</RelativeFilePath> <CommandLineParam>/param1 /param2</CommandLineParam> </RecoveryTools> </Recovery>

    The Recovery menu item shows up just fine but when I click it it shows a blank screen then goes back to the previous menu.

    I tried executing the hta from command prompt of the recovery menu and get access denied. So, I tried launching again from command prompt instead using MSHTA.exe x:\recovery\winre\tools\tool.hta, no access denied but nothing is displayed.

    To make sure my setup was ok, i configured a cmd script instead of the hta and it worked ok. So, i minimized the hta to basically a blank page, and again I can't get it to launch.

    I used dism to add all the necessary packages to support hta but still not luck.

    Am I spinning my wheels for nothing? are hta files even supported?


    Wednesday, March 1, 2017 3:34 AM

All replies

  • Hi Paul77MTL,

    According to my research, it should be available to custom HTA tool to WinRE but we should add the HTA packages from a Windows 10 PE to WinRE image.

    Here is a link for reference:
    Walkthrough: Create a Windows RE Image
    "dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\"
    dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\en-us\""

    Replace the tool with X64 PE if you custom a X64 WinRE. Use "Get-packages" command to verify it has been added successfully.

    Best regards

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Thursday, March 2, 2017 6:33 AM
  • Hi MeipoXu,

    Yes, I already have all the necessary packages in the wim. I was able to get it working with winpeshl.ini and command prompt.

    Here is the code. Looks like I needed a double backslash or else it would find the file. Also, I needed to add mshta.exe since there is no program associated with the HTA filetype.

    AppPath=mshta.exe "x:\\sources\\recovery\\tools\\tool.hta"

    I tried to use the same command in WinREConfig.xml. But it still will not load from the recovery button.

    <?xml version="1.0" encoding="utf-8"?> <!-- WinREConfig.xml --> <Recovery> <RecoveryTools> <RelativeFilePath>mshta.exe "x:\\sources\\recovery\\tools\\tool.hta"</RelativeFilePath> <CommandLineParam>/param1 /param2</CommandLineParam> </RecoveryTools> </Recovery>

    I was not able to find much information about  WinREConfig.xml. Maybe it just needs to be called in a different may?

    Thursday, March 2, 2017 2:00 PM