日期:2014-05-17  浏览次数:20799 次

winscp在windows下批处理通过SSH端口上传文件
要执行的命令保存成文件willrun,内容:

option confirm off

open user:pwd@host1
put c:\test.txt /root/tmp
close

open user:pwd@host2
put c:\test.txt /root/tmp
close

open user:pwd@host3
synchronize remote c:\tmp /root/tmp -delete-----如果在目标机器存在,则加delete参数
close

exit





保存。





然后执行cmd

"c:\Program Files\WinSCP\WinSCP.exe" /console /script=c:\willrun.txt