简体   繁体   English

在VBScript中调用exe

[英]Calling exe in the VBScript

I am trying to pass an exe path in the VBScript to call it automatically. 我试图在VBScript中传递exe路径以自动调用它。 Please suggest. 请提出建议。

Path to pass : 通过路径:

C:\Program Files\TSVN\bin\Tor.exe"/command:repobrowser
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(""C:\Program Files\TSVN\bin\TProc.exe"/command:repobrowser"") 'Not working
Set objShell = Nothing

The quotes have not been escaped correctly causing in string to be incorrectly terminated, try this; 引号未正确转义,导致字符串错误地终止,请尝试此操作;

Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("""C:\Program Files\TSVN\bin\TProc.exe""/command:repobrowser")
Set objShell = Nothing

The string is equivalent to 该字符串等效于

"C:\Program Files\TSVN\bin\TProc.exe"/command:repobrowser

Useful Links 有用的链接

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

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