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

PK

Scripting: get command - delete option Deleting Directories

When I use the get command with -delete in my script to recursively search, download and delete the downloaded files within subdirectories, it is deleting the directories/subdirectories on the host
My command is
"get ""/Directory/*"" -delete -resume -preservetime -filemask=*.dat ""C:\Temp_Download\""" ^

I have read in another topic (Directory Deleted Unexpectly During GetFiles) "if the ftp directory ends without the "/*" then all the files will be downloaded but the folder will be removed along with the files."
However, my problem is that I am using the "/*" and my directories are still being deleted

I am using WinSCP version 6.5.2

Is there a way of recursevly working through subdirectories downloading and deleting files but still keeping the directory structure in place??