0

I am trying to pass an exe path in the VBScript to call it automatically. 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
user692942
  • 16,398
  • 7
  • 76
  • 175
Praveenks
  • 1,436
  • 9
  • 40
  • 79

1 Answers1

6

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

Community
  • 1
  • 1
user692942
  • 16,398
  • 7
  • 76
  • 175