strCommand = """c:\program files\Bitvise Tunnelier\sftpc.exe""" &_
" -profile=c:\sftpc_profiles\Eckoh.tlp" &_
" -cmd=cd /Test; get ivraddsupdcsv020305 C:/IVR -o -b"
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strCommand)
Set objStdOut = objScriptExec.StdOut
WScript.Echo objStdOut.ReadAll
strCommand = """c:\program files\Bitvise Tunnelier\sftpc.exe""" &_
" -profile=c:\sftpc_profiles\Eckoh.tlp" &_
" -cmd=""cd /Test; get ivraddsupdcsv020305 C:/IVR -o -b"""
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strCommand)
Set objStdOut = objScriptExec.StdOut
WScript.Echo objStdOut.ReadAll
strCommand = """c:\program files\Bitvise Tunnelier\sftpc.exe""" &_
" -profile=c:\sftpc_profiles\Eckoh.tlp" &_
" -cmd=""cd /Test; get ivraddsupdcsv020305 C:/IVR -o -b; exit"""
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strCommand)
Set objStdOut = objScriptExec.StdOut
WScript.Echo objStdOut.ReadAll
strCommand = """c:\program files\Bitvise Tunnelier\sftpc.exe""" &_
" -profile=c:\sftpc_profiles\Eckoh.tlp" &_
" -cmd=""cd /Test; get ivraddsupdcsv020305 C:/IVR -o -b; exit"""
WScript.Echo strCommand
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strCommand)
Set objStdOut = objScriptExec.StdOut
WScript.Echo objStdOut.ReadAll
strCommand = "c:\sftpc.exe -profile=c:\sftpc_profiles\Eckoh.tlp" &_
" -cmd=""cd /Test; get ivraddsupdcsv020305 C:/IVR -o -b; exit"""
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand
Hey,
Probably because of the extra ", the Chr(34) you've got in there.
The quotes can be escaped with another quote, meaning "" gives you one quote in a string. So if we want the main path in quotes we would do:
objShell.Run """c:\program files\Bitvise Tunnelier sftpc.exe"" -profile=c:\sftpc_profiles
It can also be written like this if you prefer to stick with concatenating the Chr(34)'s:
objShell.Run Chr(34) & "C:\Program Files\Bitvise Tunnelier sftpc.exe" & Chr(34) & " -profile=c:\sftpc_profiles
If you do it the second way remember that you'll need that space after you restart the string or it might break the command anyway.
In all cases it's a single line, no line breaks included in the command. It would perhaps be neater to break the line with a _. For example:
objShell.Run """c:\program files\Bitvise Tunnelier sftpc.exe""" &_
" -profile=c:\sftpc_profiles
" -cmd=cd /Test; get ivraddsupdcsv020305 C:/IVR -o -b"
HTH
Chris