使用WinSCP的SFTP传输在/ command上工作但在/ script上失败

问题描述 投票:1回答:1

我正在尝试使用WinSCP将文件上传到远程SFTP服务器。当我使用/command时它可以工作,但是当我使用/script参数在脚本文件中使用相同的参数时,它会失败。下面是/command参数工作的cmd截图。

c:\winscp>WinSCP.com /command "open ftps://user:[email protected]/" "put filename.xml" "exit"
Connecting to sf-ftp.ebiaas.com:990 ...
TLS connection established. Waiting for welcome message...
Connected
Starting the session...
Session started.
Active session: [1] [email protected]
filename.xml         |           7 KB |   33.6 KB/s | binary | 100%

但是当我使用/script做同样的事情时,它失败了。

c:\winscp>WinSCP.com /script="C:\Development\UploadData.txt" /log=log.txt
Connecting to sf-ftp.ebiaas.com:990 ...
TLS connection established. Waiting for welcome message...
Access denied.
Authentication failed.

脚本文件UploadData.txt的内容是:

open ftps://user:[email protected]/
put filename.xml
exit

我不确定我是否遗漏了某些内容或以错误的方式使用WinSCP客户端。我读了here,但它只是说如果映射驱动器上的文件失败,访问被拒绝。但是在两种情况下都应该失败。还有另一个帖子here但不确定是否相同。

任何帮助,将不胜感激。

file-upload ssis sftp winscp ftps
1个回答
1
投票

使用/log=c:\path\to\log.log开关启用两个脚本中的日志记录。还可以使用/loglevel=*开关启用密码记录。

https://winscp.net/eng/docs/commandline#logging

并比较两个日志文件,找出造成差异的原因。

© www.soinside.com 2019 - 2024. All rights reserved.