Upload file with specific filename

Advertisement

fairudyn
Joined:
Posts:
6
Location:
Singapore

Upload file with specific filename

Hi,

I'd like to ask if I have for example a list 5 of files in local directory but i only wish to upload the latest 2 files (Retail001 and Points003) How do I put a mask on the winscp script

Eg.
Retail001.txt
Customer009.txt
Margin001.txt
Stores005.txt
Points003.txt

I generated this script below. It connects but noting was uploaded

lcd C:\Users\Fai\Desktop\Test
cd /

put -filemask="Retail001; Points003; <1D" Customer009.txt

exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,567
Location:
Prague, Czechia

Re: Upload file with specific filename

WinSCP scripting can upload only the latest file (using -latest switch). But not two latest files.
https://winscp.net/eng/docs/scriptcommand_put#latest

If you need to upload multiple latest files, you need to use a more powerful language.
You can combine these two scripts:
https://stackoverflow.com/q/29787005/850848#31501901
https://stackoverflow.com/q/49408964/850848#49431169

Reply with quote

Advertisement

You can post new topics in this forum