I am trying to launch a program called WebDrive from a vbscript but I cant get the syntax right to launch the program with a number of parameters; currently run from a batch file:
start /wait /D "c:\program files\webdrive" webdrive.exe /s:"syd-ftp.thruinc.net"
My base code is:
Set objShell = CreateObject("cscript.Shell")
objShell.Run start /wait /D c:\program files\webdrive webdrive.exe /s:"syd-ftp.thruinc.net"""
Set objShell = Nothing
I have read a number of posts on this site relating to this topic but I cant seem to get the quotes right, for example:
Set objShell = CreateObject("cscript.Shell")
objShell.Run "start /wait /D ""c:\program files\webdrive"" webdrive.exe /s:"""syd-ftp.thruinc.net"""
Set objShell = Nothing
Any advice would be great.
Regards
Martin
Here is a generic way to launch using VBScript:
CONNECT:
Set objShell = CreateObject("WdScript.Shell") objShell.Run """C:\Program Files\WebDrive\webdrive.exe"" /s:""site""" Set objShell = Nothing
DISCONNECT:
Set objShell = CreateObject("WdScript.Shell") objShell.Run """C:\Program Files\WebDrive\webdrive.exe"" W: /d" Set objShell = Nothing
The site part of it is dependent on your particular site profile, and the W:
is dependent on the drive letter you selected to use. Whatever drive letter you chose should go where the W is.
Specifically for this instance, you could:
CONNECT:
Set objShell = CreateObject("WScript.Shell") objShell.Run """C:\Program Files\WebDrive\webdrive.exe"" /s:""syd-ftp.thruinc.net""" Set objShell = Nothing
DISCONNECT:
Set objShell = CreateObject("WScript.Shell") objShell.Run """C:\Program Files\WebDrive\webdrive.exe"" W: /d" Set objShell = Nothing
Remove one of the double quote here!
You can echo out the command first to check whether it is in correct quote or not
I use
WScript.Shell
to createobjShell
instead ofcscript.shell
. It seems ok.