ftp -s:filename hosts >result.txt 執行腳本,并將結果定向輸出到result.txt 腳本內容,如 cd mydir ls bye 可以將mydir命令列出 然后使用批處理分析result.txt 從150 Opening ASCII mode data connection for file list.的下一行開始算,直到226 Transfer complete都是要下載的內容 然后用批處理加ftp腳本,使用get命令逐個下載
但實際過程中發現,在FTP腳本中使用get有問題,提示參數錯誤,無法使用。
查看了ftp的幫助ftp -?
G:>ftp -? Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively.