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-07-23 17:55
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Question: how do you use for in DOS? View 858 Replies 1
Original Poster Posted 2003-10-28 00:00 ·  中国 安徽 合肥 电信
初级用户
★★
Credits 311
Posts 62
Joined 2003-08-16 00:00
22-year member
UID 8721
Gender Male
Status Offline
I read the manual too but still didn't quite understand it; the explanation was too sketchy. Asking the experts here.
一切都会好起来的
Floor 2 Posted 2003-10-28 00:00 ·  中国 辽宁 沈阳 联通
初级用户
★★
Credits 672
Posts 216
Joined 2003-06-12 00:00
23-year member
UID 4976
Gender Female
Status Offline
Format: for %% in do
Function: repeatedly execute the DOS command in the for statement.
For example: suppose the batch file abc.bat contains the following:

for %%c in (*.txt) do type %%c

The result of executing it is that it displays the contents of all files with the txt extension in the current directory one by one. The loop does not end until all of them have been displayed.

Equivalent to executing the type command one file at a time
我是女孩,我怕谁?
Forum Jump: