3

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
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

4

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)

cheesemacfly
  • 11,622
  • 11
  • 53
  • 72
  • Thanks - that was the answer I was looking for. I think in older versions of Winscp the passive mode was not default but I could be wrong. We also upgraded to the latest version and things are running smooth. – hunter california Jan 23 '13 at 16:04
  • 1
    You are right, it has been added in the `5.0.2 beta` (http://winscp.net/tracker/show_bug.cgi?id=165) – cheesemacfly Jan 23 '13 at 16:12