简体   繁体   English

如何在HTA文件中使用VBScript打开应用程序

[英]How to open an appication using VBScript within an HTA file

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. 我在使用HTML应用程序( GitHub上的MeowcatSoftware Launcher Demo.HTA )打开目标应用程序(例如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? 除了使用Wscript.shell对象之外,有没有办法使用VBScript打开目​​标应用程序(如MultiTool),这导致了我的大部分问题?

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. 该博客文章还提到使用Windows Shell对象而不是Wscript.shell,但它看起来像Windows Shell对象方法用于使用其他程序打开文件的示例,我只是想让它只是打开目标应用程序。 How do I open a program using VBScript within an HTA Application? 如何在HTA应用程序中使用VBScript打开程序?

In vbscript this should work : You should using quote ( " ) not like you posted in your question ( ) and ( ) 在vbscript中这应该工作:你应该使用quote( " )不像你在问题中发布的那样( )和(

Call RunProgram()

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM