Topic "Uploading all files in a folder in order"

Author Message


I have a process that will generate anywhere between 5 and 17 files nightly. These files will have to be uploaded in a certain order. Since I cannot predict which files will be generated nightly I have hard time figuring out how to write a script to upload files in correct order. In what order, by default, does WinSCP upload files? Does it use timestamps and go in ascending order?

What would happen if I have a command in the script to upload a file that doesn't exist? Will the whole process fail?

Thanks for the help!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
WinSCP uploads the files in the order in which they are returned by Windows in the directory listing (so its in-deterministic).

By default the script fails when the file does not exist.
You can change this with option batch command:

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License