jay
jay

Reputation: 21

Opening HTA file from another HTA file

Alright, so I am creating a simple program that should, when you click the link open another .HTA file. For example:

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

Then later on...

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

However, it returns a 'Variable is undefined: objShell' error. I am trying to get virus_support.hta to open up from the SupportMain.hta file...not on IE or any browser.

Upvotes: 0

Views: 3390

Answers (1)

Donald Duck
Donald Duck

Reputation: 8902

Try this:

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

Upvotes: 0

Related Questions