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-06-20 10:47
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » The Strongest DOS Command – for (It is a good resource for novices to learn the FOR statement) View 53,116 Replies 259
Floor 241 Posted 2008-08-28 23:55 ·  中国 山东 济南 电信
新手上路
Credits 0
Posts 1
Joined 2008-08-28 22:55
17-year member
UID 124437
Gender Male
Status Offline
Thanks o(∩_∩)o...
Need to study it
Floor 242 Posted 2008-08-29 00:29 ·  中国 广西 梧州 联通
新手上路
Credits 12
Posts 6
Joined 2006-07-19 13:40
19-year member
UID 58841
Status Offline
After reading it, I have benefited a lot...
Floor 243 Posted 2008-09-17 18:53 ·  中国 浙江 杭州 电信
初级用户
Credits 38
Posts 17
Joined 2008-09-11 17:07
17-year member
UID 125416
Gender Male
Status Offline
Originally posted by liuyong at 2006-10-27 11:24 AM:
A bit confused!

Floor 244 Posted 2008-09-19 11:03 ·  中国 上海 电信
初级用户
Credits 24
Posts 11
Joined 2008-09-17 23:25
17-year member
UID 125908
Gender Male
Status Offline
The statement: for /r . %a in (*.txt) do @find "bluebear" %a needs to be corrected:
for /r %a in (*.txt) do find "bluebear" %a
With the statement written by the original poster, it can't be executed. Please verify.
Floor 245 Posted 2008-09-19 19:43 ·  中国 江西 赣州 赣县区 电信
新手上路
Credits 6
Posts 3
Joined 2008-09-15 21:11
17-year member
UID 125726
Gender Male
From 江西、
Status Offline
Floor 246 Posted 2008-09-20 15:04 ·  中国 江苏 南通 如皋市 电信
新手上路
Credits 6
Posts 3
Joined 2008-09-19 18:08
17-year member
UID 126075
Gender Male
Status Offline
Floor 247 Posted 2008-09-28 15:34 ·  中国 广东 深圳 电信
新手上路
Credits 12
Posts 6
Joined 2008-09-28 11:38
17-year member
UID 126873
Gender Male
From 江西省宜春市
Status Offline
For beginners, it's really not easy to understand.
勤劳致富.多学多用.
Floor 248 Posted 2008-09-29 10:15 ·  中国 江苏 苏州 昆山市 电信
初级用户
★★
Credits 160
Posts 75
Joined 2006-06-28 01:07
19-year member
UID 57661
Gender Male
Status Offline
for is really powerful, collect it and study it slowly
Floor 249 Posted 2008-09-29 11:12 ·  中国 北京 联通
初级用户
Credits 36
Posts 19
Joined 2007-12-29 10:53
18-year member
UID 107102
Gender Male
Status Offline
The FOR command is too flexible... Not easy to master.. It's okay when used.
Floor 250 Posted 2008-09-30 18:29 ·  中国 山东 潍坊 电信
初级用户
Credits 26
Posts 12
Joined 2008-09-29 21:37
17-year member
UID 127030
Gender Male
Status Offline
Originally posted by youlangyu at 2008-9-19 11:03:
for /r . %a in (*.txt) do @find "bluebear" %a
This statement needs to be corrected:
for /r %a in (*.txt) do find "bluebear" %a
With the statement written by the original poster, it cannot be executed. Please verify.


No need to correct, it can run and works normally in the cmd of XP. The "@" can be omitted.
C:\22>for /r . %a in (*.txt) do @find "qwert" %a

---------- C:\22\1.TXT
qwert

---------- C:\22\2.TXT
sdfsdqwert

---------- C:\22\3.TXT


[ Last edited by 55467015 on 2008-9-30 at 18:32 ]
Floor 251 Posted 2008-10-05 13:00 ·  中国 四川 攀枝花 电信
新手上路
Credits 7
Posts 4
Joined 2008-10-04 13:17
17-year member
UID 127392
Gender Male
Status Offline
Floor 252 Posted 2008-10-05 14:17 ·  中国 贵州 贵阳 电信
新手上路
Credits 6
Posts 3
Joined 2008-05-01 22:11
18-year member
UID 117499
Gender Male
Status Offline
Good
Floor 253 Posted 2008-10-05 15:31 ·  中国 青海 西宁 电信
新手上路
Credits 7
Posts 4
Joined 2008-09-09 17:29
17-year member
UID 125242
Gender Male
Status Offline
Floor 254 Posted 2008-10-05 23:32 ·  中国 广东 东莞 电信
初级用户
Credits 61
Posts 39
Joined 2007-03-22 16:49
19-year member
UID 82575
Gender Male
From come from hb--wh
Status Offline
In batch processing, the FOR command is really very powerful. Hehe~~ I just suddenly had an epiphany and understood this damn tokens parameter command.. The post is very detailed.. Support````
Floor 255 Posted 2008-10-07 13:17 ·  中国 河南 郑州 电信
新手上路
Credits 4
Posts 2
Joined 2008-10-07 12:03
17-year member
UID 127641
Gender Male
Status Offline
After reading the original poster's post, I feel that my own learning is too superficial. I will focus on learning in the future.
Forum Jump: