使用 WinSCP 的 SFTP 传输适用于 /command 但在 /script 上失败

SFTP transfer using WinSCP works on /command but fails on /script

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

c:\winscp>WinSCP.com /command "open ftps://user:pass@sf-ftp.ebiaas.com/" "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] user@sf-ftp.ebiaas.com
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:pass@sf-ftp.ebiaas.com/
put filename.xml
exit

我不确定我是否遗漏了某些东西或以错误的方式使用了 WinSCP 客户端。我读了 here but it just says the access is denied if files on mapped drive fails. But then it should have failed in both the scenarios. There is another post here 但不确定是否相同。

如有任何帮助,我们将不胜感激。

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

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

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