window下批處理操作:從Linux機器下拷貝檔案

來源:互聯網
上載者:User

標籤:批處理   bat   bvs   

檔案名稱:test.bat

set THIS_BAT_PATH=%~dp0cd %THIS_BAT_PATH%rd /s /q %SDV_LLT_PATH% & md %SDV_LLT_PATH%
  • 當前檔案所在的路徑:THIS_BAT_PATH=%~dp0 

  • cd %THIS_BAT_PATH%進入到當前檔案所在路徑

  • 刪除該檔案,並建立該檔案:rd md


call plink.exe -ssh -pw  password [email protected] cd /home/test;rm test.tar.gz;tar -zcvf test.tar.gz test
  • 在window上串連linux伺服器10.21.34.53 並進入到/home/test檔案目錄下,刪除test.tar.gz,並將test壓縮


::windows端解壓cd /d %RAR_PATH%WinRAR.exe x -y %SDV_LLT_PATH%\*.tar.gz %SDV_LLT_PATH%
  • 將SDV_LLT_PATH路徑下的檔案解壓


call %root%\pscp.exe -pw root [email protected]:/home/test.tar.gz %destPath%
  • 將Linux伺服器下的檔案拷貝到windows機器上:前提是必須在test.bat所在目錄檔案下存放pscp.exe檔案,上述命名是將10.24.15.60Linux機器下的test.tar.gz拷貝到本地windows機器上,目的路徑是desPath


xcopy %SRC_PATH%\test.tar.gz %DEST_PATH%\/e /y /s
  • 在windows機器上將test.tar.gz拷貝到目的地址上

window下批處理操作:從Linux機器下拷貝檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.