3

We are using many HTA scripts. In order to test the newer version of Windows we installed Windows8 with IE 10. We are currently using an application (.exe) as a hub to start the correct hta that needs to run.

We are using this setup on 2000,XP,Vista,7 machine with IE ranging from 6 to 9 and it worked fine so far. But the application has stop to work on the latest windows.

Here is my question: Is there a known issue with HTA called by another application under Windows 8 and IE10?

Here is an example with two HTA scripts:

If you run test_2.hta the script works, if you run the script test_1 the script works but test_2.hta does not start.

1- test_1.hta

    <html>
       <head>
          <title> Test </title>
       </head>
       <script>
          new ActiveXObject("WScript.Shell").Run("mshta test_2.hta", 1, false);
      </script>
      <body>
         Allo buddy
      </body>
    </html>

2- test_2.hta

    <html>
       <head>
          <title> Test </title>
       </head>
       <script>
          alert('Hello world');
      </script>
      <body>
         Allo buddy
      </body>
    </html>

Any idea?

David Laberge
  • 15,435
  • 14
  • 53
  • 83

1 Answers1

2

This sample works fine for me. I removed 'mshta'. When using cmd.exe command 'start' you don't need to include the app, only the document file and will use file associations (.hta) launch the right app (iexplore/mshta). Seems to work in this case.

<html>
    <head>
        <title> Test </title>
    </head>
    <script>
        new ActiveXObject("WScript.Shell").Run("hardware.hta", 1, false);
    </script>
    <body>
        <p>Allo buddy</p>
        <p><a href=http://www.robvanderwoude.com/htaexamples.php>The only good HTA samples.</a></p>
    </body>
</html>
yzorg
  • 4,224
  • 3
  • 39
  • 57
  • If you're looking to launch as console, not iexplore window, take a look at this question. http://stackoverflow.com/questions/5690134/running-command-line-silently-with-vbscript-and-getting-output – yzorg Jan 09 '13 at 07:30