如何自动进行文件传输WINSCP

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

今天早些时候我在使用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
1个回答
0
投票

WinSCP中没有goto命令。

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

goto

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

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