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

sundar2013

Re: Batch Script Parameters - Not working

Thank you Sir, Now the parameter is working perfectly.

Regards,
Sundaramurthy J.
sundar2013

Batch Script Parameters - Not working

WinSCP - Version 5.12
Version of Windows - Windows 7
Transfer Protocol - SFTP
Error : Error changing directory to '%1%'.

In Arguments I am passing the below value -script="XXXXXX" -privatekey="XXX.ppk" -parameter="P:\Interface\Backup Files" -log="P:\Interface\winscp.log"

Batch Script :
option batch off
option confirm off
option transfer binary
open sftp:XXXXXXXXXXX -hostkey= XXXXXXXXXXXXXX
cd XXXXXXXX
lcd "%1%"
get *.txt
exit

Error : I am getting an error "Error changing directory to '%1%'". I believe that the batch file doesn't understand the parameter value. "%1%" not taking the value. IF I directly hardcode the path in text file, everything works fine, but I don't want to hard code the server name. Did I use the correct version of Winscp that support parameters?

Please help me.

Thanks.
Sundaramurthy J.