Board logo

标题: 命令行的“如果命令扩展名被启用”啥意思啊? [打印本页]

作者: klot     时间: 2006-9-12 22:18    标题: 命令行的“如果命令扩展名被启用”啥意思啊?

俺是菜鸟,这句话不明白,是学for命令的时候看见的。

另外,那位能给个for命令的教程,网上找的,不是照般for的帮助,就是写的不对,它举个例子我照抄上都运行不了,鸡眼了复制上也运行不了。。谢谢,谢谢。
作者: 9527     时间: 2006-9-12 22:23
看一下这里:
http://www.cn-dos.net/forum/view ... ighlight=%2Bbagpipe

也许你对FOR命令就会有了新的领悟 ........
作者: klot     时间: 2006-9-12 22:30
多谢

可是我运行它的例子还是不行啊,请帮看看怎么回事:(我复制上去的。。)

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

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

klot[D:\hktools\cmd]\>for %a in (c: d: e: f do @dir %a\ find "bytes free" )
命令语法不正确。

klot[D:\hktools\cmd]\>

[ Last edited by klot on 2006-9-12 at 22:33 ]
作者: 9527     时间: 2006-9-12 23:25
我劝你要学习他的语法,不要急于执行和调试他的命令

执行这个试试 for %a in (c: d: e:) do @dir %a\|find "可用字节"
如果想要执行以下语句有效之前需执行
CHCP 437 然后执行以下代码,因为他用 “bytes free” 作为查找条件的
for %a in (c: d: e:) do @dir %a\|find "bytes free"
作者: namejm     时间: 2006-9-13 00:34
  “bytes free” 是英文状态下的屏幕显示,在你中文状态下的CMD中是不可能出现的。
作者: klot     时间: 2006-9-13 01:36
多谢指点
我开始也不想运行代码啊,但是要是不运行,我就看不到效果,而且也不怎么相信教程里面写的是不是好使。。象我这么菜,错误的代码大概看不出来,所以只好运行一下咯,实践不是了解事物的最好手段么,呵呵。

最后还是谢谢两位的帮助。

这个是我运行之后的结果,好使了:)
klot[D:\hktools\cmd]\>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 ]
作者: vkill     时间: 2006-9-13 05:38
实践是了解事物的最好手段

呵呵,是这么说,不过条件是在大概了解的时候