Topic "Passing a file name in the command line to a script"

Author Message


I have a .bat file that is calling winscp with a /script. The script needs to upload a file through SFTP. I would like to be able to pass the file name that is to be uploaded via the command line. I see in the FAQ ( where this is addressed if the file name has spaces in it; however, my files do not have spaces in it so I was hoping that the steps addressed on this page were not necessary and there was an easier way to accomplish this. If it can be passed as a command line parameter, can you say what the parameter would be as well as how to pick up that parameter value within the script itself (is it %1?)

Thanks so much
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26858
Location: Prague, Czechia
Parameters cannot be passed into script. But you can setup complete script on command line using /command parameter.
Martin Prikryl

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