Batch Script Parameters - Not working

Advertisement

sundar2013
Joined:
Posts:
8

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.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum