Post a reply

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)


Topic review


many thanks!

found example code, but it won't let me connect

hello everyone
i found some example code on the internet, but it won't let me connect to the SFTP.

i've been using FileZilla for SFTP transfers, but am now in the need for some automated scripting. so i came across WinSCP. every day i connect to a remote folder and there are just under 100 files. and every day i'm downloading a dozen from there, and that list of files i need varies by day of week. so i want to automate that :)

i found this thread here and then copied the script mentioned in there

but the shell tells me host "username" does not exist. so something must be wrong in the syntax that i copied from there.

this is my script:
# Connect to the host and login using password

[b]open s[/b]
# Change the remote directory
cd remotetargetpath
# get all the files in the remote directory and download them to a specific local directory
get *example_pattern*.csv localtargetpath
# Close and terminate the session

what am i doing wrong?
i tried the documentation/help on here, searched for the "open" command, but can't find syntax :(