Ghost Solution Suite

 View Only
Expand all | Collapse all

Adding HTA & VBS support in winPE created by GSS

  • 1.  Adding HTA & VBS support in winPE created by GSS

    Posted Aug 26, 2014 02:52 AM

    Hi,

    I am trying to create some menus using HTA & VB scripts.

    But I see we donot have the required support in the WinPe created by GSS 2.5.

    Is there a way to add the support to the WinPE image offline or onlline?

     

    Thanks,
    Basavesh



  • 2.  RE: Adding HTA & VBS support in winPE created by GSS
    Best Answer

    Posted Aug 26, 2014 10:16 AM

    Check out this article:

    https://www-secure.symantec.com/connect/articles/readyadventures-winpe

    This describes the end-to-end creation of WinPE boot media, including the loading of the different support modules.

    Just bear in mind that each added module increases the size of the boot.wim file marginally, but this is unlikely to be an issue with modern hardware.



  • 3.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Aug 27, 2014 10:05 AM

    Thanks for the link.

    I was able to install WAIK, get a new wim file and add the HTA & scripts packages, able to run the hta application.

    Now I found that the vbscript buttons in the hta dont work. On clicking the button, I get the blank script error screen.

    Below is the code I tried.

     

    code>

    <HTML>
      <HEAD>
        <TITLE>Menu</TITLE>
          <HTA:APPLICATION
            ID = "MyMenu"
            APPLICATIONNAME = "Menu"
            >
          <Script language="VBScript">
            
            Sub RunCmd
              MsgBox("Nothing")
            End Sub

          </Script>
      </HEAD>

      <BODY>

        <Input type="button" value="Run CMD" name="RunCMD" onclick="RunCMD">

      </BODY>
    </HTML>

    </code>



  • 4.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Aug 27, 2014 11:03 AM

    I don't think this is the root cause of your problem but when coding, I would stick to one format, and not mix "RunCmd" and "RunCMD" in case the code is case sensitive.

    Perhaps if you explain what you are trying to do it would help. I had no problems coding a multi-button menu in HTA under WinPE, but don't have my code to hand at the moment.



  • 5.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 01, 2014 10:40 AM

    Wow, sharp eyes.. I did miss the difference in case sensitivity. I corrected it and tested but same result.

    With this test code I was trying to check if the vbscript button is actually the problem.

    I see it works fin on my laptop. But errors out in WinPE, when button is clicked.

     

    My actual code has a button(with required warning message popups) for the user to restore the image to the system. This is part of a bootable USB. Our service people use the USB to restore the image in field.

    Till now we had a PCDOS based USB and a UI on command prompt. I am trying to replace it with a GUI using HTA & VBscript because of several reasons (ex: some of our validation logic before restoring uses certain command prompt executibles which donnot work in WinPE).

    Is there a way to test it outside the WinPE (on my laptop), so that I don't have to boot with WinPE to test the hta/vbscript.

    Also any ideas on why is vbscript giving errors on WinPE, when it runs fine on my laptop.

    Note: WAIk version I used is    6001.18000.080118-1840-kb3aikl_en.iso

     

    Thanks,

    Basavesh



  • 6.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 01, 2014 02:51 PM

    If you set up a VM with access to your local hard disk, you can boot the VM to WinPE and then run the HTA code directly from your local machine's disk without having to boot it up repeatedly. Laptops can run a VM without any issues these days.

    I created a USB hard disk solution that booted WinPE and ran a control program in HTA format that would format/partition the target hard disk and then detect the machine connected (using WMI) and offer the technician one or more builds suitable for that machine.

    I will try and find the code so if you can mail me your direct email I will send it to you.



  • 7.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 02, 2014 09:00 AM

    Thats a good idea, will try to get a VM on my laptop.

    I have sent you an email with my ID. Thanks for helping with the code.

    Any suggestions on how to debug if the script errors on clicking the button.

    Would it be a IE related issue?

     

    Thanks,
    Basavesh



  • 8.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 02, 2014 02:05 PM

    I have indeed encountered issues arising from changes implemented by MS when moving from IE6 to later versions. So the solution is to work with the version of IE that your target audience is using and retest on any new versions as they are released.

    When I run into errors in code, I tend to spin off a tiny program that allows me to test the segment of code that is causing problems until I figure out where the error lies. With a VM it's so easy to test code iterations that tracking down issues is usually quite quick.



  • 9.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 03, 2014 01:15 AM

    I just noticed that there are many error windows (Internet Explorer Script Error) one behind the other. Found it when I moved the top error windows.

    I can't close any of them since pressing the "Yes" and "No" buttons donot close the error window.



  • 10.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 03, 2014 04:05 AM

    I have sent you the code example we discussed. I hope this will give you some pointers which will help your coding. I would recommend only testing under WinPE to avoid version issues with IE.



  • 11.  RE: Adding HTA & VBS support in winPE created by GSS

    Posted Sep 03, 2014 05:02 AM

    Thanks for the code. It will surely help me in getting the menu right.

    Meanwhile I tried creating WinPE using "KB3AIK_EN.iso". This is Windows 7 based WAIK (I guess I have WinPE 3.0 now).

    To this image I added the hta and scripting packages. And my code works on this. No more vbscript errors. Hurray..