Board logo

标题: 怎样用批处理文件ftp自动登录ftp网站上传文件 [打印本页]

作者: hantao2000     时间: 2004-6-3 00:00    标题: 怎样用批处理文件ftp自动登录ftp网站上传文件

怎样用批处理文件ftp自动登录ftp网站上传文件
作者: Climbing     时间: 2004-6-3 00:00
我以Windows 2003的ftp命令为例,输入ftp -h,可以看到帮助:

Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]

  -v              Suppresses display of remote server responses.
  -n              Suppresses auto-login upon initial connection.
  -i              Turns off interactive prompting during multiple file
                  transfers.
  -d              Enables debugging.
  -g              Disables filename globbing (see GLOB command).
  -s:filename     Specifies a text file containing FTP commands; the
                  commands will automatically run after FTP starts.
  -a              Use any local interface when binding data connection.
  -A              login as anonymous.
  -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
  -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
  -b:async count  Overrides the default async count of 3
  -w:buffer size  Overrides the default transfer buffer size of 65535.
  host            Specifies the host name or IP address of the remote
                  host to connect to.

Notes:
  - mget and mput commands take y/n/q for yes/no/quit.
  - Use Control-C to abort commands.

你一定注意到了对-s:filename参数的说明。

在硬盘上建立一个script.txt,内容如下:
open
anonymous
user@the.net
cd public
put test.txt
bye

注:以上仅是示例,请根据实际情况修改。

然后运行命令:
ftp -s:script.txt
作者: lxmxn     时间: 2006-9-18 04:01    标题: 经典!

呵呵,一直想用一个批处理自动登陆到我的FTP里面去,没想到可以用这个来自动完成,顶2楼的。。。
作者: feitian     时间: 2007-5-6 19:19    标题: 请教高手

我按照上面的提示去做为什么会出现
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]

  -v              Suppresses display of remote server responses.
  -n              Suppresses auto-login upon initial connection.
  -i              Turns off interactive prompting during multiple file
                  transfers.
  -d              Enables debugging.
  -g              Disables filename globbing (see GLOB command).
  -s:filename     Specifies a text file containing FTP commands; the
                  commands will automatically run after FTP starts.
  -a              Use any local interface when binding data connection.
  -A              login as anonymous.
  -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
  -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
  -b:async count  Overrides the default async count of 3
  -w:buffer size  Overrides the default transfer buffer size of 65535.
  host            Specifies the host name or IP address of the remote
                  host to connect to.

Notes:
  - mget and mput commands take y/n/q for yes/no/quit.
  - Use Control-C to abort commands.

你一定注意到了对-s:filename参数的说明。

在硬盘上建立一个script.txt,内容如下:
open
anonymous
user@the.net
cd public
put test.txt
bye
我的FTP服务器是用SERV-U架设的啊!
作者: vkill     时间: 2007-5-7 08:32
搜索 "ftp"




欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) Powered by Discuz! 2.5