Simple VBScript syntax error?
I have a really simple vbscript to run WinSCP that doesn't error...but it clearly doesn't run either.
Option Explicit
Dim objFSO
Dim objShell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run """C:\Program Files\WinSCP\winscp.exe /console /command """ & """option batch abort""" & " " & """option confirm on""" & " " & """option transfer ascii""" & """open sftp://username:password@mycompany.com""" & """get textfile.txt C:\file\path\textfile.txt""" & " " & """close""" & " " & """exit"""
Wscript.Quit
What am I doing wrong?
Ed
Option Explicit
Dim objFSO
Dim objShell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run """C:\Program Files\WinSCP\winscp.exe /console /command """ & """option batch abort""" & " " & """option confirm on""" & " " & """option transfer ascii""" & """open sftp://username:password@mycompany.com""" & """get textfile.txt C:\file\path\textfile.txt""" & " " & """close""" & " " & """exit"""
Wscript.Quit
What am I doing wrong?
Ed