Post a reply

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

wdodds

Script to automate SFTP file download and delete from SFTP

Hi all,
I'm trying to setup a new WinSCP file download process from an SFTP site with a ssh-rsa key. I walked through the process to "Generate Script" but when I look at the script it generated it has 3 specific files listed in the get -delete section as:
get -delete T_100191359_received_10_07_2022_GL.xml
get -delete T40917_60214_10_07_2022_08_43_29_945_PM.xml
get -delete T40917_60214_10_07_2022_08_43_29_972_GL.xml
 
exit

Works fine obviously the 1st time but files I'm needing to retrieve will always be different names, there could be 1 file, no files or 100 files. Basically I need a wild card or grab everything in the SFTP folder with a .xml extension and download syntax which I can't seem to find.