Topic "Filemask switch when using GET"

Author Message
locksonline
[View user's profile]

Joined: 2013-01-23
Posts: 3
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

Code:
get *.txt


works just fine.

However, the following does not:

Code:
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,

Quote:
Missing parameter for command 'get'


Any help or guidance greatly appreciated.

PS. WinSCP is version 5.1.2
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You want to do either:
get -filemask="*.txt" *
(copies all *.txt files recursively)
get *.txt
(copies all *.txt file non-recursively)
_________________
Martin Prikryl
locksonline
[View user's profile]

Joined: 2013-01-23
Posts: 3
prikryl 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.
thardon

Guest


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.

Code:
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
locksonline
[View user's profile]

Joined: 2013-01-23
Posts: 3
I think I managed to get this working with the following line:

get -filemask="yourString"* *.txt

HTH
thardon

Guest


Thanks for your help! Smile

Unfortunately it doesn't work for me. Sad 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..
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Ok, so you want WinSCP to skip subfolders that contain no .csv files, right? WinSCP cannot do this.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License