WinSCP命令行被动模式 [英] WinSCP command-line passive mode

查看:965
本文介绍了WinSCP命令行被动模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过命令行调用WinSCP,但是我无法弄清楚如何正确地为脚本设置被动模式。



现在这个脚本:

p>

  $ b $ option期权确认
$ b $开启ftp:// user_and_pass_details:21
cd / out /

选项转换二进制
把C:\afile.text

关闭
出口

解决方案

您可以在打开时指定被动选项:

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

您的完整脚本将变成:

  

上的选项批次选项确认关闭

打开ftp:// user_and_pass_details:21 -passive =在

cd / out /

选项转换二进制

把C:\afile.text

关闭

出口

请参考: http://winscp.net/eng/docs/scriptcommand_open

(不管怎样,请注意,默认情况下,被动模式是活动的: http://winscp.net/eng/docs/ui_login_connection#connection

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

解决方案

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)

这篇关于WinSCP命令行被动模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆