none
HTA VBS errors in WinPE are blank! Why? RRS feed

  • Question

  • Hi folks,

    I have an HTA which has some VBS.

    Whenever I get a script error, a blank dialog box appears. Blue top bar, with an X, no text, and a large white box, no text or buttons.

    The WinPE version we are using, if I type VER, is 6.1.7600.

    Any ideas why this happens... and how to fix it? Would be really handy to know what line my script errors occur on. At the moment I have to put msgbox's in to try to catch where the error lies.

    Thanks.

    Wednesday, January 15, 2014 5:20 PM

Answers

  • Well, I couldn't find a "PE" forum.... so I guess I will ask in the "deployment" forum.
    • Marked as answer by MrBeatnik Thursday, January 16, 2014 3:13 PM
    Thursday, January 16, 2014 3:13 PM

All replies

  • I don't know, but my guess is that HTAs would be second-class citizens on WinPE (use at your own risk) so you're probably on your own.

    Bill

    Wednesday, January 15, 2014 5:37 PM
    Moderator
  • No way to know without the code.


    ¯\_(ツ)_/¯

    Wednesday, January 15, 2014 6:01 PM
  • Generally, provided you have the component installed, they are the preferred (and supported) way to create menus and automated systems for PE.
    Thursday, January 16, 2014 10:06 AM
  • Well I really don't think the code has anything to do with it; but here is an example if you can help!

    <head>
    <title>HTA Test</title>
    <HTA:APPLICATION
         SCROLL="auto"
         CAPTION="no"
         SINGLEINSTANCE="yes"
         navigable="yes"
    
    >
    </head>
    
    	<script language="VBScript">
    	Function runTest
    		msgbox "If I just had this code, all would be fine!"
    		msgbox This code here generates an error (for obvious reasons) but in WinPE the error is blank. It still throws up a box - it's just blank!
    	End Function
    	</script>
    
    
    <body onload="runTest()">
    	Well, this is as simple an HTA as you can get, right? Well, almost.
    </body>
    
    

    Thursday, January 16, 2014 10:08 AM
  • The code you pasted retains the problem.  YOu are saving the file as Unicode.  Save it as ANSI and it will produce better output.

    The blank message box should only happen when you have an unhandled syntax error.  Fix the error then all will be OK.

    Yes - WinPE is a limited functionality version of Windows used to bootstrap.


    ¯\_(ツ)_/¯

    Thursday, January 16, 2014 1:40 PM
  • The code was already in ANSI, but to be sure, and follow your advice, I saved again ensure it was ANSI.

    The problem persists.

    Please note - this is NOT a blank "message box" (as in msgbox) that is appearing.

    It is just a blank box, that should be the unhandled error message, and it occurs regardless of what code error is made (be it on a msgbox as above, or any type of statement or declaration, etc).


    "Fix the error then all will be OK."

    Which error? I don't understand what error is causing a blank box to appear, instead of the usual message "An error has occurred in the script on this page" "Line 15, Char 15, Error: Expected end of statement"

    THAT is what I want to see, rather than a blank box.

    Thursday, January 16, 2014 2:40 PM
  • You should not use the Body "onload" to generate an error.  There is no UI when the onload event is fired.  onload is usually used to set up variables prior to display of the body.

    Errors in HTML/HTA are not handled the same as in VBScript an are platform sensitive.  JUst write good HTA code and debug it prior to running on PE. 

    The MDT currently eliminates  the need for an HTA in most cases.  Try using the MDT to build your UI interaction.

    Deployment issues with PE are better posted in the deployment forum ass there is a larger body of expertise there.


    ¯\_(ツ)_/¯

    Thursday, January 16, 2014 2:48 PM
  • "You should not use the Body "onload" to generate an error.  There is no UI when the onload event is fired.  onload is usually used to set up variables prior to display of the body."

    The same problem happens if I present a button in HTML and fire the function that way. It is not related to the onload event. Regardless of whether it's a button trigger or an onLoad trigger (or any other event), the error appears in Windows 7, but not Windows PE. I just used the onLoad event in my example to show a quick issue without any interaction.

    "Errors in HTML/HTA are not handled the same as in VBScript an are platform sensitive.  JUst write good HTA code and debug it prior to running on PE."

    As you mentioned, platform sensitive. Something that runs in Windows 7 may not run in WinPE due to missing components and other issues. I need to debug in PE for the solutions I am creating.

    "The MDT currently eliminates  the need for an HTA in most cases.  Try using the MDT to build your UI interaction."

    Doesn't help my issue here. My question remains; I'm trying to find the answer to a specific question, not workarounds or alternatives.

    "Deployment issues with PE are better posted in the deployment forum ass there is a larger body of expertise there."

    I'm not deploying anything... but I would be happier to post in a PE forum if there is one as this isn't particularly a scripting issue (there is no code problem). Would you regard the deployment forum a PE forum? If so, I'll move over there. Otherwise, do you have a better suggestion that would act as a PE forum?

    Thursday, January 16, 2014 3:02 PM
  • Well - that is it.  If someone has your issues I am sure they will post. 

    You should post in the PE forum for PE specific issues.  This is not  a scripting issue.  It is a platform issue.


    ¯\_(ツ)_/¯

    Thursday, January 16, 2014 3:05 PM
  • Well, I couldn't find a "PE" forum.... so I guess I will ask in the "deployment" forum.
    • Marked as answer by MrBeatnik Thursday, January 16, 2014 3:13 PM
    Thursday, January 16, 2014 3:13 PM
  • Have you tried regenning a new PE image with minimal bits then testing your HTA?  It is possible that something you have added to the mage has caused this issue.


    ¯\_(ツ)_/¯

    Thursday, January 16, 2014 3:15 PM
  • Why would you say that? Microsoft uses HTA files extensively in MDT.
    • Edited by Wolverine58 Wednesday, August 6, 2014 1:24 AM
    Wednesday, August 6, 2014 1:23 AM
  • Why would you say that? Microsoft uses HTA files extensively in MDT.

    Where did you see that?  Show me.

    ¯\_(ツ)_/¯

    Wednesday, August 6, 2014 1:30 AM
  • I had the same issue in WinPE 5.1. In my case helped adding this file to boot image (copied from W81):

      \Windows\system32\en-us\ieframe.dll.mui 

    • Proposed as answer by henrivdr Thursday, November 26, 2015 10:45 AM
    Thursday, March 26, 2015 6:33 PM
  • HTA debugging from WinPE is troublesome because of the behavior you describe.  I almost always have a syntax error the first time I make a new HTA.  My only work around is to run it within a full Windows environment, just to get the line number with the syntax error.  I have not been able to add this debugging functionality to PE as of yet.
    • Proposed as answer by Mike Plichta Friday, May 27, 2016 5:11 PM
    Friday, May 27, 2016 5:11 PM
  • Today is the day that everyone comes up with answers to very old and fully marked as answered questions.  It must be Friday afternoon anxiety.  No one wants to work so they kibitz on TechNet.

    Note that using MDT eliminates 99.9% of all issues needing an HTA.  HTAs are soon to be gone.

    Consider updating you technologies to a more modern platform.  It will save you a lot of time and trouble.

    https://technet.microsoft.com/en-us/windows/dn475741.aspx


    \_(ツ)_/

    Friday, May 27, 2016 5:34 PM
  • "Consider updating you technologies to a more modern platform.  It will save you a lot of time and trouble."

    Kinda rude there, ain't ya? You do not know the circumstances of why that person or myself still use HTA for Windows PE.

    But if you must know, The answer that pr1pencroft provided was the solution to the issue. Just copy ieframe.dll.mui from \Windows\System32\en-us (I copyied from Windows 7 machine) to the \Windows\System32\en-us directory in the WinPE environment and now the error message displays as it should instead of a blank box.


    • Edited by SonicAretak Tuesday, June 28, 2016 7:59 PM Clarify statement
    Tuesday, June 28, 2016 7:57 PM
  • Thank you, pr1pencroft...this fixed the issue for me anyway.
    Tuesday, June 28, 2016 7:58 PM
  • What is the current method of making custom menus in Windows PE if not in HTA format?  

    From what I see, MDT still uses WSF files which is still VB Script even if it doesn't use HTML controls. 

    I've played with Powershell GUI controls but don't like how much the boot.wim file increases in size if you add the powershell module to it.  Perhaps it's unfamiliarity with PowerShell, but it feels like there a bunch more overhead to making a GUI than there is in HTA format. 

    Monday, August 1, 2016 10:20 PM
  • Thank you for this.  I suspect I'll need the ieframe.dll.mui from windows 8.1 if I'm using Wine PE5 but it'll save a ton of development time.  
    Monday, August 1, 2016 10:32 PM
  • A WSF is not an HTA.  A WSF is a structured (XML) container for scripts and allows both JScript and vbscript to interoperate.  It is not part of MDT but is a part of WSH.

    HTML files use "controls"  It is HTML/DGTML that uses the controls.  VBScript does not use HTML controls. VBScript is used in HTML and HTA to allow scripting of the DOM.  The VBScript in HTML/HTA is not identical to a VBS file or a WSF file.

    PowerShell is a trivial add there to PE except if you insist on continuing to use floppy disks;)


    \_(ツ)_/

    Monday, August 1, 2016 10:39 PM