Windows上传文件到Linux服务器不用输入密码的脚本
1、下载winscp软件(用它来实现不用手动输入密码)
2、编辑.txt文件用来调用执行,如:test.txt
option echo off
option batch on
option confirm off
open scp://用户:密码@IP:端口号
cd /home #服务器上传路径
put D:\server_push\jar\push\*.jar #本地文件路径,不能是中文目录
#call cat text.txt #call 可远程输入Linux命令
option transfer binary
close #关闭scp连接
# Exit WinSCP
#exit #退出
3、创建一个test.bat脚本,用来点击执行
WinSCP.exe /console /script=D:\server_push\jar\test.txt #txt脚本的路径
4、找到winscp安装目录下的,WinSCP.exe,
将WinSCP.exe拷贝到和test.bat相同目录下,因为执行脚本需要用到它,这样就不用进入WinSCP.exe目录去执行脚本了。
---------是故无冥冥之志者----------
---------无昭昭之明----------
---------无惛惛之事者----------
---------无赫赫之功----------
本文来自博客园,作者:|是吴啊|,转载请注明原文链接:https://www.cnblogs.com/wuguofeng/p/15108606.html

浙公网安备 33010602011771号