今天早些时候我在使用scprit时遇到问题,现在脚本本身正在运行,但我想使其循环。
开始脚本(.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
[也尝试过,但是CMD告诉我“未知命令'While'。我用谷歌搜索,可以通过保存文件ASCII来解决问题,但它也不起作用。
WinSCP中没有goto
命令。
但是Windows批处理文件中有goto
command,因此您可以这样做:
goto
有关更复杂的代码,请参见WinSCP :start
winscp.com /script=SyncToRemoteScript.txt
goto start
。