WinSCP自动化脚本实现上传文件 | 您所在的位置:网站首页 › 批量上传文件到ftp脚本 › WinSCP自动化脚本实现上传文件 |
下一个bat脚本,在bat脚本中执行winscp程序 D:\WinSCP\WinSCP.exe /console /command "option batch abort" "option confirm off" "open scp://root:password@IP" "exit" D:\WinSCP\WinSCP.exe为winscp的路径 /console /command 表示在后面直接输入命令 option batch abort 中止批处理 option confirm off 关闭提示信息 open scp://root:password@IP open scp://用户名:密码@IP地址 put 文件路径
或者将winscp命令放在一个txt文件中,在bat脚本中调用 D:\WinSCP\WinSCP.exe /console /script=D:\winscp1.txt /console /script 表示运行winscp中的命令 winscp.txt 中的内容为: option batch abort option confirm off open scp://root:[email protected] cd /opt option transfer binary //通过二进制上传文件 put D:\dmi.tar.gz //上传文件D:\dmi.tar.gz exit close
winscp的命令 call 执行任意远程Shell命令 // 例如 call sed -i '20a hello' aa.txt 在远程文件aa.txt的2 |
CopyRight 2018-2019 实验室设备网 版权所有 |