How do I script WinSCP to only transmit specific files in a specific order

Advertisement

Shango
Guest

How do I script WinSCP to only transmit specific files in a specific order

I have a task where a large file (300-500MB) must be sent to a remote directory, followed by three much smaller files (1K each). The files must be transmitted in a specific order, with the largest going first, followed by the remaining three. The order would look like this (for example):

001_Testfile_0001.zip
001_Testfile_0001.ack
04_Testfile_0001.csv
04_Testfile_0001.ack

I should add that the ZIP file has to be in place before the first ACK file, so the order above is important. I can't find anywhere in the help to advise how to write a script to do this with WinSCP. Is it possible? Any help would be appreciated. I'm new to SFTP and scripting in general, so please bear with me.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: How do I script WinSCP to only transmit specific files in a specific order

Just use 4 consecutive upload (put) commands:

put 001_Testfile_0001.zip
put 001_Testfile_0001.ack
put 04_Testfile_0001.csv
put 04_Testfile_0001.ack

Reply with quote

Shango
Guest

Re: How do I script WinSCP to only transmit specific files in a specific order

martin wrote:

Just use 4 consecutive upload (put) commands:

put 001_Testfile_0001.zip
put 001_Testfile_0001.ack
put 04_Testfile_0001.csv
put 04_Testfile_0001.ack

Sorry for got to mention there's about 30 or 40 files similarly named. So theres also 001_Testfile_0002.zip, 001_Testfile_0002.ack etc...

Reply with quote

martin
Site Admin
martin avatar

Re: How do I script WinSCP to only transmit specific files in a specific order

So then you have to write a script (e.g. PowerShell) that generates WinSCP script with the files in the order you need.

Reply with quote

Advertisement

You can post new topics in this forum