Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinSCP command-line passive mode

I am calling WinSCP via command line but I can't figure out how to set passive mode properly to the script.

Here is the script now:

 option batch on
 option confirm off

 open ftp://user_and_pass_details:21
 cd /out/

 option transfer binary
 put C:\afile.text

 close
 exit
like image 649
hunter california Avatar asked Jun 22 '26 22:06

hunter california


1 Answers

You can specify the passive option in your open:

open ftp://user_and_pass_details:21 -passive=on|off

Your full script will become:

 option batch on

 option confirm off

 open ftp://user_and_pass_details:21 -passive=on

 cd /out/

 option transfer binary

 put C:\afile.text

 close

 exit

Please refer to: http://winscp.net/eng/docs/scriptcommand_open
(anyway, note that by default, the passive mode is active: http://winscp.net/eng/docs/ui_login_connection#connection)

like image 109
cheesemacfly Avatar answered Jun 28 '26 12:06

cheesemacfly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!