Topic "Input filename condition from user at beginning of script."

Author Message


I have to download a number of files on a weekly basis from a ftp. The filenames remain the same from week to week except there is a date code added to the file. eg "image22.tif", where 22 is the week number. Naturally the file next week would be called "image33.tif". Would there be a way to prompt the user at start up for the we number, in this case "22", and then merrily go off and download all the files I need. Think this would be possible?


A correction to the original post... the second file should have been named "image23.tif", not "image33.tif". Also "prompt the user at start up for the we number" should have read "prompt the user at start up for the week number".

So, aside from all that. I was going through some example scripts and one was checking the timestamp of the remote files. So how about I just get the script to calculate the current week and add it to the file name string and just like the example if it is there, download it, if not, then write that the file does not exist yet.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27068
Location: Prague, Czechia
WinSCP script does not support any kind of custom prompting nor calculation.

You can however prompt user from wrapping batch file and pass the answer to WinSCP script.

To access the entered value from the script, either store it to environment variable or pass it using /parameter switch.

You can post new topics in this forum


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