Filemask switch when using GET

Advertisement

locksonline
Joined:
Posts:
3

Filemask switch when using GET

OK, I have done a fair amount of searching and I am still stumped with time ticking on.

I have a windows .bat file which then runs a winscp.txt file with commands via the console.

The winscp.txt file runs a number of commands successfully and the command

get *.txt    

works just fine.

However, the following does not:

get -filemask="*.txt"    

I thought it maybe an issue with the quotes, so have tried with or without quotes and or double quotes, etc.

The error being returned in the windows command prompt when running the .bat file is,

Missing parameter for command 'get'

Any help or guidance greatly appreciated.

PS. WinSCP is version 5.1.2

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,227
Location:
Prague, Czechia

Re: Filemask switch when using GET

You want to do either:
get -filemask="*.txt" *
(copies all *.txt files recursively)
get *.txt
(copies all *.txt file non-recursively)
_________________
Martin Prikryl

Reply with quote

locksonline
Joined:
Posts:
3

Re: Filemask switch when using GET

martin wrote:

You want to do either:
get -filemask="*.txt" *
(copies all *.txt files recursively)
get *.txt
(copies all *.txt file non-recursively)

Many thanks for your reply, I have it working now.

Reply with quote

thardon
Guest

Folders are copied when using filemask

I tried the same as 'locksonline'. Ok, I've changed txt to csv and I'm downloading to Windows temp file but I think that's not the problem.

GET -filemask="*.csv" * D:\temp\    

Result of this codeline is that winscp copies many, many empty folders from remote to local. Am I doing anything wrong?

WINSCP is version 5.1.3

Reply with quote

thardon
Guest

Thanks for your help! :)

Unfortunately it doesn't work for me. :( Now, It's copying no files at all.
The csv-Files are stored in sub-folders. Maybe that's why this one copies no files. WINSCP has to search recursively through all sub-folders. And it seems you have to use * as remote path..

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,227
Location:
Prague, Czechia

Ok, so you want WinSCP to skip subfolders that contain no .csv files, right? WinSCP cannot do this.

Reply with quote

Advertisement

You can post new topics in this forum