從Windows向Linux自動化發送文件

来源:互联网 发布:其皆出于此乎 编辑:程序博客网 时间:2024/04/29 01:05

本例是基於WinScp工具的。


1. 只用一條CMD語句:

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


它存在一個問題,就是打開WinScp的命令行窗口後不會關閉,誰有自動關閉它的方法請留言,先行致謝。

2. 測試通過

第一步:寫一個文本文檔(run.txt)內容如下:

option confirm offopen username:password@serverIPput licence.txt /home/coolbeans/closeexit


第二步:寫一個批處理文件,內容如下:

WinSCP.exe /console/script=run.txt




0 0
原创粉丝点击