Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Passing a file name in the command line to a script

Parameters cannot be passed into script. But you can setup complete script on command line using /command parameter.
ldaugher

Passing a file name in the command line to a script

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 (https://winscp.net/eng/docs/scripting#quotes) 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
Laura