如何使用WinSCP连续上传文件

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

我希望我的WinSCP脚本循环。

开始脚本(.bat文件)

winscp.com /script=SyncToRemoteScript.txt
pause

我的脚本(.txt文件)

open ftp://usernam:password@myhost/ -hostkey="ssh-ed25XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="
put D:\folder /home/myuser/public_html/wp-content/themes/newtheme
exit

我尝试过这样的GOTO方法–不起作用。

:start
open ftp://usernam:password@myhost/ -hostkey="ssh-ed25XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="
put D:\folder /home/myuser/public_html/wp-content/themes/newtheme
goto start

也尝试过while,但是CMD告诉我“未知命令'While'”。我用谷歌搜索,可以通过保存文件ASCII来解决问题,但是它也不起作用。

batch-file ftp winscp
1个回答
1
投票

WinSCP中没有goto命令。

但是Windows批处理文件中有goto command,因此您可以这样做:

goto

有关更复杂的代码,请参见WinSCP :start winscp.com /script=SyncToRemoteScript.txt goto start


尽管您似乎试图不断更新远程目录,但请考虑使用:

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