本例是基於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