excluding subdirectories using "get" in batch file

Advertisement

jawa230
Guest

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.

Reply with quote

Advertisement

jawa230
Guest

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?

Reply with quote

jawa230
Guest

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.

Reply with quote

Advertisement

You can post new topics in this forum