【问题标题】:Does Windows8 and IE10 support HTA applications?Windows8 和 IE10 是否支持 HTA 应用程序?
【发布时间】:2013-01-09 15:24:37
【问题描述】:

我们正在使用许多 HTA 脚本。为了测试较新版本的 Windows,我们安装了带有 IE 10 的 Windows8。我们目前正在使用应用程序 (.exe) 作为集线器来启动需要运行的正确 hta。

我们在 2000、XP、Vista、7 机器上使用这个设置,IE 范围从 6 到 9,到目前为止它运行良好。但该应用程序已停止在最新的 Windows 上运行。

这是我的问题: 在 Windows 8 和 IE10 下,其他应用程序调用的 HTA 是否存在已知问题?

这是一个包含两个 HTA 脚本的示例:

如果您运行 test_2.hta 脚本可以运行,如果您运行脚本 test_1 脚本可以运行但 test_2.hta 不会启动。

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>

有什么想法吗?

【问题讨论】:

  • 这可能很愚蠢,但应该是:...Run("mshta.exe /test_2.hta", 1, false);?
  • 感谢您的想法,但遗憾的是它没有奏效。

标签: windows-8 hta internet-explorer-10


【解决方案1】:

这个示例对我来说很好用。我删除了“mshta”。使用 cmd.exe 命令“启动”时,您不需要包含应用程序,只需包含文档文件并将使用文件关联 (.hta) 启动正确的应用程序 (iexplore/mshta)。在这种情况下似乎有效。

<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>

【讨论】:

猜你喜欢
  • 2014-06-18
  • 2013-02-03
  • 2016-01-05
  • 2011-10-22
  • 2014-11-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-09
相关资源
最近更新 更多