中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-02 02:27
48,037 topics / 350,122 posts / today 2 new / 48,250 members
DOS批处理 & 脚本技术(批处理室) » What does "if command extensions are enabled" in the command line mean?
Printable Version  1,592 / 6
Floor1 klot Posted 2006-09-12 22:18
初级用户 Posts 22 Credits 168
I'm a newbie, and I don't understand this sentence. I saw it when learning the for command.

Also, can someone give a tutorial on the for command? What I found online is either just copying the help of for or written incorrectly. I copied the example it gave and it didn't run, and even copied it and it didn't run. Ugh. Thanks, thanks.
Floor2 9527 Posted 2006-09-12 22:23
银牌会员 Posts 438 Credits 1,185 From 北京
Look at here:
http://www.cn-dos.net/forum/viewthread.php?tid=19331&fpage=1&highlight=%2Bbagpipe

Maybe you will have a new understanding of the FOR command ........
Floor3 klot Posted 2006-09-12 22:30
初级用户 Posts 22 Credits 168
Thanks

But I still can't run its example, please help see what's wrong: (I copied it up.)

klot\>for %a in (c: d: e: f do @dir %a\   find "bytes free"
More?
More?
More?

klot\>for %a in (c: d: e: f do @dir %a\ find "bytes free"
More?

klot\>for %a in (c: d: e: f do @dir %a\ find "bytes free" )
The syntax of the command is incorrect.

klot\>

[ Last edited by klot on 2006-9-12 at 22:33 ]
Floor4 9527 Posted 2006-09-12 23:25
银牌会员 Posts 438 Credits 1,185 From 北京
I advise you to study his grammar, don't be eager to execute and debug his commands. Try executing this: for %a in (c: d: e:) do @dir %a\|find "available bytes"
Before the following statement is effective, you need to execute CHCP 437 and then execute the following code, because he uses "bytes free" as the search condition: for %a in (c: d: e:) do @dir %a\|find "bytes free"
Floor5 namejm Posted 2006-09-13 00:34
荣誉版主 Posts 1,737 Credits 5,226 From 成都
“bytes free” is the screen display in English state, and it is impossible to appear in the CMD in your Chinese state.
Floor6 klot Posted 2006-09-13 01:36
初级用户 Posts 22 Credits 168
Thanks for the guidance.
I didn't want to run the code at first either, but if I didn't run it, I couldn't see the effect, and I didn't really believe if the code in the tutorial would work. Like me, who is so noob, I probably can't spot wrong code, so I had to run it. Isn't practice the best way to understand things, heh.

Finally, thanks to both of you for the help.

This is the result after I ran it, and it worked:)
klot\>for %a in (c: d: e:) do @dir %a\|find "bytes free"
4 Dir(s) 1,807,380,480 bytes free
8 Dir(s) 2,930,888,704 bytes free
10 Dir(s) 3,651,493,888 bytes free

[ Last edited by klot on 2006-9-13 at 01:41 ]
Floor7 vkill Posted 2006-09-13 05:38
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
Practice is the best way to understand things

Hehe, that's what it is said, but the condition is when you have a general understanding
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023