【发布时间】:2016-05-17 15:41:03
【问题描述】:
我可以使用以下代码在CMD 窗口中从 SFTP 下载文件:
WinSCP.com
# Connect to the host and login using password
open user:pw@address
# get all the files in the remote directory and download them to a specific local directory
lcd C:\Users\xx\Desktop
get *.xlsx
# Close and terminate the session
exit
我在网上搜了一下,发现可以把这些代码放在一个bat文件中,然后使用
Call Shell("cmd.exe /c C:\Users\xx\Desktop\WinSCPGet.bat", 1)
但是,只有 bat 文件 WinSCP.com 的第一行正在执行。它将弹出cmd 窗口,显示此内容,无需执行任何其他操作。
如何一次执行所有的行?
谢谢
【问题讨论】: