从Windows向Linux自动化发送文件

本例是基于WinScp工具的。


1. 只用一条CMD语句:

WinSCP.exe /console  scp://username:password@serveripaddress:/home/coolbeans/ licence.txt


它存在一个问题,就是打开WinScp的命令行窗口后不会关闭,谁有自动关闭它的方法请留言,先行致谢。

2. 测试通过

第一步:写一个文本文档(run.txt)内容如下:

option confirm off

open username:password@serverIP

put licence.txt /home/coolbeans/

close

exit


第二步:写一个批处理文件,内容如下:

WinSCP.exe /console/script=run.txt




发布了62 篇原创文章 · 获赞 0 · 访问量 10万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章