FTP整站上傳的批處理指令碼

來源:互聯網
上載者:User

標籤:style   blog   http   color   檔案   io   

一個FTP整站上傳的批處理代碼。
例子:

@echo offrem 設定FTP伺服器位址set ftpIP=192.168.0.2rem 設定FTP使用者名稱set ftpUser=MyUserrem 設定FTP密碼set ftpPass=MyPassrem 設定待上傳的本地檔案夾目錄set UpFolder=C:/testrem 產生待上傳的本地資料夾清單type nul>%temp%/FolderList.txtfor /r "%UpFolder%" %%a in (.) do (set FullName=%%asetlocal enabledelayedexpansionset FolderName=!FullName:%UpFolder%=!set FolderName=!FolderName:~1,-2!echo,!FolderName!>>%temp%/FolderList.txtendlocal) ## www.jbxue.com>"%temp%/ftpFile.txt" echo,%ftpUser%>>"%temp%/ftpFile.txt" echo,%ftpPass%>>"%temp%/ftpFile.txt" echo bin>>"%temp%/ftpFile.txt" (for /f "usebackq tokens=*" %%a in ("%temp%/FolderList.txt") do (echo cd /echo mkdir "%%a"echo cd "/%%a"echo mput "%UpFolder%/%%a/*.*"))>>"%temp%/ftpFile.txt" echo ! rd /s /q "%UpFolder%">>"%temp%/ftpFile.txt" echo ! md "%UpFolder%">>"%temp%/ftpFile.txt" echo byeftp -v -i -s:"%temp%/ftpFile.txt" %ftpIP%

更多有關批處理的教程,請參考連結:http://www.jbxue.com/tags/pichuli.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.