2012-11-10 46 views
0

好的,所以我创建了一个简单的程序,当你点击链接时打开另一个.HTA文件。例如:从另一个HTA文件打开HTA文件

Sub RunProgram 
    Const NORMAL_WINDOW = 1 
    Set objShell = CreateObject("Shell.Application") 
    objShell.ShellExecute "explorer.exe", "Virus_Support.hta", , , NORMAL_WINDOW 
End Sub 

再后来就......

<body> 
<button onclick="RunProgram">Run Program</button> <p> 
</body> 

但是,它返回一个 '变量未定义:objShell' 的错误。我试图从SupportMain.hta文件中打开virus_support.hta ...而不是IE或任何浏览器。

+0

其实卫生技术评估是由mshta.exe运行。尝试'mshta.exe'而不是'explorer.exe'。我认为'Virus_Support.hta'还需要完整路径。顺便说一句,你在做什么,支持病毒听起来可疑=)。 – Teemu

+0

感谢您的回复。 – jay

+0

我看到......)。你有没有让你的代码使用'mshta.exe'? – Teemu

回答

0

试试这个:

Sub RunProgram 
    Set objShell = CreateObject("WScript.shell") 
    objShell.run("Virus_Support.hta") 
End Sub