1
votes

I am having trouble with getting the HTML Application (MeowcatSoftware Launcher Demo.HTA on GitHub) to open a target application, for example, MultiToolv0.2.exe. Is there a way to open the target applications such as the MultiTool using VBScript besides using Wscript.shell objects, which has been causing most of my problems?

I have tried the following, which didn't work:

Sub RunProgram  
    Set objShell = CreateObject(“Wscript.Shell”)  
    objShell.Run “notepad.exe c:\script\test.txt”  
End Sub  

(From 'Hey, Scripting Guy" Blog Post)

I played around a little with it but couldn't figure out how to achieve my goal. The blog post also mentioned using a Windows Shell object instead of Wscript.shell, but it looks like from the example that the Windows Shell object method was for opening a file using another program, and I just want it to simply open the target application. How do I open a program using VBScript within an HTA Application?

1
It is hard to answer without knowing your problems. It is not clear if the problem is starting the HTA or starting something from the HTA, what you have tried and what did fail. Please, edit your question and provide more information. - MC ND
WScript.Shell.Run runs its first argument exactly the same way as you'd have written it to the command line ... Maybe it's only in the post, but smart quotes are not supported by VBScript, use regular double quotes (") instead. - Teemu

1 Answers

0
votes

In vbscript this should work : You should using quote (") not like you posted in your question () and ()

Call RunProgram()

Sub RunProgram  
    Set objShell = CreateObject("Wscript.Shell")  
    objShell.Run "notepad.exe c:\script\test.txt"  
End Sub