get with files in a list

Advertisement

Saul1
Joined:
Posts:
13
Location:
Germany

get with files in a list

Hello,
in a program I check what files I need to download onto my computer. Now I have a do while what calls winscp with the new file name. But it takes long to open and close the connection.
winscp.com /command "open sftp://revision:test#1@sftp.mysftp.test.com/ " "get users/revision/file1.pdf \daten\
The file names change with each program call. Is it possible to store the file names in a separate file list like file.txt and call winscp including the filelist.txt somehow to download all filenames included in the file file.txt?

Thanks
Wolfgang

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: get with files in a list

Just repeat the get command as many time as you need:

winscp.com /command "open ..." "get users/revision/file1.pdf \daten\" "get users/revision/file2.pdf \daten\" "get users/revision/file3.pdf \daten\" ...

If the folders are the same always, you can even use a single get command like:

winscp.com /command "open ..." "cd users/revision" "get file1.pdf file2.pdf file3.pdf ... \daten\" ...

See https://winscp.net/eng/docs/scriptcommand_get

Reply with quote

Advertisement

You can post new topics in this forum