clt wrote:
Hi Martin, or anybody..
Is it possible to control the order of files uloading on the server? I have .gpg and .chk files and winscp uload .chk firstly (I assume that in alphabetical order). I need to upload e.g. first.gpg, then first.chk, second.gpg then second.chk etc. Thank you!
You could either:
1) Script it externally then call WinSCP with a known list of files to transfer.
2) Run multiple WinSCP passes over your source directory, first transferring *.gpg, then *.chk.
Here's an extract of a Windows Batch script that will append file names to an existing SFTP Batch Script
--------------------------------
DIR /a-d /b *.gpd %source.path% >%SFTP.batch.filelist%
DIR /a-d /b *.chk %source.path% >>%SFTP.batch.filelist%
:: If there are no files in the source directory to transfer, leave the script.
if errorlevel==1 (@ECHO Nothing To Do - Exiting Script)&(Goto :EOF)
@ECHO File Listing Complete
:: Now echo the file names to the script, including the SFTP.OPERATION we want to perform.
@ECHO Echo the file names to the SFTP Script file
for /f "tokens=*" %%A in (%SFTP.batch.filelist%) do (echo PUT -preservetime "%%A" >>%SFTP.batch.script%)
--------------------------------