mahonglin123456 发表于 2015-5-27 11:22:34

FTP批量下载

  DownLoadLog.bat文件:
  cd /d D:\VB_Transfer_Log   
ftp -s:commands.ini Host
  commands.ini文件:
  用户名   
密码   
prompt#去除确认框   
mget *.txt   
quit
  
  微软的参考资料:
  Ftp
  Transfers files to and from a computer running a File Transfer Protocol (FTP) server service such as Internet Information Services. Ftp can be used interactively or in batch mode by processing ASCII text files.
Syntax
  ftp [-v] [-d] [-i] [-n] [-g] [-s:FileName] [-a] [-w:WindowSize] [-A] [Host]
  Top of page
Parameters
  -v : Suppresses the display of FTP server responses.
  -d : Enables debugging, displaying all commands passed between the FTP client and FTP server.
  -i : Disables interactive prompting during multiple file transfers.
  -n : Suppresses the ability to log on automatically when the initial connection is made.
  -g : Disables file name globbing. Glob permits the use of the asterisk (*) and question mark (?) as wildcard characters in local file and path names. For more information, see Ftp: Glob
  -s: FileName : Specifies a text file that contains ftp commands. These commands run automatically after ftp starts. This parameter allows no spaces. Use this parameter instead of redirection ( command prompt.
   
[*]     For more information about ftp subcommands, see Related Topics.
   
[*]     Ftp supports the use of IPv6 when the IPv6 protocol is installed. For more information, see IP version 6 and IPv6 applications

  Top of page
Examples
  To log on to the FTP server named ftp.example.microsoft.com, type the following command:
  ftp ftp.example.microsoft.com
  To anonymously log on to the FTP server named ftp.example.microsoft.com, type the following command:
  ftp -A ftp.example.microsoft.com
  To log on to the FTP server named ftp.example.microsoft.com and run the ftp commands contained in a file named Resynch.txt, type the following command:
  ftp -s:resynch.txt ftp.example.microsoft.com
  Top of page
Formatting legend
  Format
  Meaning
  Italic
  Information that the user must supply
  Bold
  Elements that the user must type exactly as shown
  Ellipsis (...)
  Parameter that can be repeated several times in a command line
  Between brackets ([])
  Optional items
  Between braces ({}); choices separated by pipe (|). Example: {even|odd}
  Set of choices from which the user must choose only one
  Courier font
  Code or program output
  Ftp subcommands
  Command-line reference A-Z
页: [1]
查看完整版本: FTP批量下载