我希望我的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来解决问题,但是它也不起作用。
WinSCP中没有goto
命令。
但是Windows批处理文件中有goto
command,因此您可以这样做:
goto
有关更复杂的代码,请参见WinSCP :start
winscp.com /script=SyncToRemoteScript.txt
goto start
。
尽管您似乎试图不断更新远程目录,但请考虑使用:
synchronize remote
command连续更新修改的文件(并且您不需要任何循环)。