Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: WINSCP SFTP transfert issue with a Put command

You are missing some quotes and spaces:

Call Shell( _
"""C:\Program Files (x86)\WinSCP\WinSCP.com""  /command " & _
"""open ftpes://... ..."" " & _
"""put C:\Users\sent_FTP\testfile.csv"" " & _
"""exit""")
End Sub


See https://winscp.net/eng/docs/commandline#syntax
Pat35

WINSCP SFTP transfert issue with a Put command

Hello
i wrote the script below in Outlook VBA :

Call Shell( _
"C:\Program Files (x86)\WinSCP\WinSCP.com  /command " & _
"""open ftpes://customer:password@ftpclients.com/ -timeout=5 -certificate=xxxxxxx -rawsettings ProxyPort=0""" & _
"""put C:\Users\sent_FTP\testfile.csv""" & _
"""exit""")
End Sub


when i executes the script, i see in a CMD windows that the remote FTP server is open but the file is not transfered
the command visible in window is : winscp >
if i copy past the command "put C:\Users\sent_FTP\testfile.csv" in CMD windows, that is working very well, the file is transfered

i don't understand why the script doesn't execute the command "put" automatically

regards

Pat