China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-11 02:40
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Closed] How to implement FTP upload of a folder with many files under DOS View 1,811 Replies 13
Original Poster Posted 2007-06-20 20:30 ·  中国 北京 联通
初级用户
Credits 78
Posts 34
Joined 2006-12-09 05:10
19-year member
UID 73001
Gender Male
Status Offline
How to implement FTP upload of a folder with quite a few files under DOS

As the title says:
I have learned on our forum~~
Already achieved:
ftp.exe -s:C:\boyhong.mmp


But in the C:\boyhong.mmp file:

I can achieve uploading one file.
But what if there is a folder with quite a few files?

Content of the C:\boyhong.mmp file:
open  ftpserver
user
key
cd remote FTP directory
lcd local directory
put local folder<<<<<-------How to handle this place, PUT is definitely not okay.
bye


The directory of the local folder is also a changing directory name generated by %data% every day

[ Last edited by HAT on 2009-1-4 at 23:26 ]
Floor 2 Posted 2007-06-20 20:31 ·  中国 北京 联通
初级用户
Credits 78
Posts 34
Joined 2006-12-09 05:10
19-year member
UID 73001
Gender Male
Status Offline
Thanks to the experts for the guidance~~First, I'll bump it myself
Floor 3 Posted 2007-06-20 21:30 ·  中国 北京 利达宽带
中级用户
★★
Credits 273
Posts 91
Joined 2007-05-07 18:12
19-year member
UID 87770
Gender Male
Status Offline
for /f "delims=" %i in ('dir /s /b xxx') do echo put %i >> C:\boyhong.mmp
Replace xxx with the directory name
Enter directly in DOS
Floor 4 Posted 2007-06-21 08:22 ·  中国 北京 联通
初级用户
Credits 78
Posts 34
Joined 2006-12-09 05:10
19-year member
UID 73001
Gender Male
Status Offline
In this folder that needs to be uploaded, there are many files and also folders. And the directory name of this folder is automatically backed up by another batch script. The format of the directory name is: "%data%oa"
Floor 5 Posted 2007-06-21 09:27 ·  中国 河北 石家庄 北京神州长城通信技术发展中心中国长城互联网
初级用户
★★
Credits 152
Posts 75
Joined 2007-02-06 22:09
19-year member
UID 78805
Gender Male
Status Offline
Floor 6 Posted 2007-06-21 10:53 ·  中国 北京 联通
初级用户
Credits 78
Posts 34
Joined 2006-12-09 05:10
19-year member
UID 73001
Gender Male
Status Offline
Floor 7 Posted 2007-06-21 20:19 ·  中国 北京 利达宽带
中级用户
★★
Credits 273
Posts 91
Joined 2007-05-07 18:12
19-year member
UID 87770
Gender Male
Status Offline
It's still relatively convenient to use FlashFXP, heh heh
Floor 8 Posted 2007-06-21 22:56 ·  中国 湖北 武汉 电信
初级用户
★★
Credits 108
Posts 56
Joined 2007-05-07 16:00
19-year member
UID 87758
Gender Male
Status Offline
Pack it first, then mput
Floor 9 Posted 2007-06-22 11:03 ·  中国 北京 联通
初级用户
Credits 78
Posts 34
Joined 2006-12-09 05:10
19-year member
UID 73001
Gender Male
Status Offline
Pack it with RAR? Then upload it~~~~~~~
Good idea~~~Thanks to the upstairs~~~~~~~
Floor 10 Posted 2007-06-22 11:48 ·  中国 上海 联通
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
//Do you want to pack it with RAR? Then upload it~~~~~~~

It is recommended to use WinZip for packing
Because files packed with WinRar cannot be extracted on Unix^_^
Floor 11 Posted 2007-11-23 18:40 ·  中国 北京 联通
初级用户
Credits 78
Posts 34
Joined 2006-12-09 05:10
19-year member
UID 73001
Gender Male
Status Offline
Now summarize:
After packaging, upload it~~But after uploading, how to extract it in the ftp? Does batch processing support running the rar extraction command in ftp?
Floor 12 Posted 2007-11-24 11:48 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Download and then rar /? Okay
Floor 13 Posted 2007-11-24 15:10 ·  中国 浙江 温州 电信
中级用户
★★
Credits 458
Posts 196
Joined 2006-10-05 12:04
19-year member
UID 64614
Status Offline
Consider curl/wget
Floor 14 Posted 2009-01-04 23:24 ·  中国 广东 深圳 龙岗区 电信
新手上路
Credits 16
Posts 9
Joined 2009-01-03 21:28
17-year member
UID 135685
Gender Male
Status Offline
How to achieve FTP download of an entire folder and its contents under DOS.
Note: Without using the packaging method
Thank you in advance!
Forum Jump: