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

jawa230

Re: excluding subdirectories using "get" in batch file

jawa230 wrote:

martin wrote:

"get -filemask=*.xml|*/ /user/config/folder/* C:\Users\Desktop\Batch\"

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


This does not work :( No files are dowloaded at all.
If I use "-filemask=*.xml", all xml files in current folder and its subdirectories are download. But adding |*/ excludes everything. Should I add path to "*.xml" in the file mask?


I think I found the cause. I did not create the folder Batch on the Desktop, so there is an error message "can not create *.xml file". After I created an empty folder "Batch", the xml files are now downloaded to that folder correctly. This is interesting, because if I use "*.xml", the script automatically creates a folder for me. But with |*/, I need to manually create a folder beforehand.
jawa230

Re: excluding subdirectories using "get" in batch file

martin wrote:

"get -filemask=*.xml|*/ /user/config/folder/* C:\Users\Desktop\Batch\"

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


This does not work :( No files are dowloaded at all.
If I use "-filemask=*.xml", all xml files in current folder and its subdirectories are download. But adding |*/ excludes everything. Should I add path to "*.xml" in the file mask?
jawa230

excluding subdirectories using "get" in batch file

I am writing a bath file to download files from a remote server.
What I need the file in the current folder, not the subdirectories.
this is my command in batch file:
"get -filemask=*.xml|*/ /user/config/folder C:\Users\Desktop\Batch"

but there is no files downloaded. If I only use "-filemask=*.xml", all xml files both in current folder and subdirectories are downloaded.

what is wrong with my code? thanks a lot.