中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-04 13:12
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 怎样用批处理文件ftp自动登录ftp网站上传文件 查看 2,906 回复 4
楼 主 怎样用批处理文件ftp自动登录ftp网站上传文件 发表于 2004-06-03 00:00 ·  中国 北京 光环新网电信数据中心
初级用户
积分 108
发帖 2
注册 2004-06-03 00:00
22年会员
UID 25953
性别 男
状态 离线
怎样用批处理文件ftp自动登录ftp网站上传文件
2 发表于 2004-06-03 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
积分 6,962
发帖 2,753
注册 2003-04-16 00:00
23年会员
UID 1565
性别 男
来自 河北保定
状态 离线
我以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 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
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
3 经典! 发表于 2006-09-18 04:01 ·  中国 湖北 武汉 电信
版主
★★★★★
积分 11,386
发帖 4,938
注册 2006-07-23 17:10
20年会员
UID 59080
状态 离线
呵呵,一直想用一个批处理自动登陆到我的FTP里面去,没想到可以用这个来自动完成,顶2楼的。。。
4 请教高手 发表于 2007-05-06 19:19 ·  中国 上海 宝山区 电信
新手上路
积分 2
发帖 1
注册 2007-05-06 14:46
19年会员
UID 87669
性别 男
状态 离线
我按照上面的提示去做为什么会出现
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP

-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架设的啊!
5 发表于 2007-05-07 08:32 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
积分 4,103
发帖 1,744
注册 2006-01-20 13:00
20年会员
UID 49241
性别 男
来自 甘肃.临泽
状态 离线
搜索 "ftp"
论坛跳转: