Re: Using the /command switch
Sorry, but that's hard to believe. When I execute your batch file (
Are you really claiming that you get something like this?
Please post a screenshot.
TestScript.txt
renamed to TestScript.bat
), even when all the paths are not valid in my environment, I get loads of output:
C:\JonWayn70>TestScript.bat
C:\JonWayn70>"c:\program files (x86)\WinSCP\WinSCP.com" /log="C:\Working\CmdLog.xml" /ini=nul /command "option batch on" "option confirm off" "open sftp://loginname:pwd2@somesite.com/ -Hostkey=""ssh-rsa 2048 blahyadablah=""" "lcd ""C:\Working\""" "get ""ACI_DONE_15524.xml""" "close" "exit"
batch on
confirm off
Error occurred during logging. It's been turned off.
Can't open log file 'C:\Working\CmdLog.xml'.
System Error. Code: 2.
The system cannot find the file specified
Searching for host...
Connecting to host...
Authenticating...
Host key does not match configured key fingerprint "ssh-rsa 2048 blahyadablah="!
Host key fingerprint is ssh-rsa 2048 9xOXCfxuuXsHJq47v6uotqYh7TH/Zs2USGKdpXMBdHM=.
Authentication failed.
Error changing directory to 'C:\Working\'.
System Error. Code: 2.
The system cannot find the file specified
No session.
No session.
C:\JonWayn70>
Are you really claiming that you get something like this?
C:\JonWayn70>TestScript.bat
C:\JonWayn70>"c:\program files (x86)\WinSCP\WinSCP.com" /log="C:\Working\CmdLog.xml" /ini=nul /command "option batch on" "option confirm off" "open sftp://loginname:pwd2@somesite.com/ -Hostkey=""ssh-rsa 2048 blahyadablah=""" "lcd ""C:\Working\""" "get ""ACI_DONE_15524.xml""" "close" "exit"
C:\JonWayn70>
Please post a screenshot.