Board logo

标题: "此时不应有" 是会什么原因 [打印本页]

作者: 024024     时间: 2006-3-30 08:54    标题: "此时不应有" 是会什么原因
想快速报告每个硬盘分区的剩余空间:

O:\old\tool>for %a in (c: d: e: f do @dir %a\ | find "bytes free"
此时不应有 |。

O:\old\tool>for /f "tokens=3" %%a in ('dir /-c c:\') do set /a freesize=%%a/1048576
此时不应有 %%a。

O:\old\tool>for /f "tokens=3" %%a in ('dir /-c c:\^|find "可用字节"') do set /a freesize=%%a/1048576

此时不应有 %%a。

作者: 3742668     时间: 2006-3-30 09:23
for %a in (c: d: e: f do @dir %a\ | find "bytes free"
改为:
for %a in (c: d: e: f<img src="images/smilies/face-laugh.png" align="absmiddle" border="0"> do @dir %a\ | find "bytes free"

只有半个括号难道,f后面也没有冒号,你没检查吗?在哪儿抄的?
后面两个你是在批处理里面用的吗?如果你是复制到命令提示符下的话应该吧%%a改成%a。
re 楼下
我嫌它太麻烦,所以平时都懒得用。

Last edited by 3742668 on 2006-3-30 at 11:47 ]

作者: willsort     时间: 2006-3-30 11:25
Re 3742668:

024024 兄应该是从本论坛获取的代码,而且这代码没有使用[code][/code]括起,也没有禁用 Smiles,导致 :) 被转换成了相应的表情字符。

建议各位发帖前,如果帖中有程序代码,需要将代码用[code][/code]括起,这样可以保证不进行任何转换,而且会使用适于代码的字体,也会增加拷贝到剪贴板的功能。

对单条语句或少量的代码,可以禁用 Smilies,在快速回复的左侧勾选相应选项即可。

另外,我会建议 Wengier 兄将 Smilies 的默认状态设置为“禁用”。

作者: 024024     时间: 2006-3-30 20:27
thinks all

作者: Climbing     时间: 2006-3-30 22:47
O:\old\tool>for %a in (c: d: e: f do @dir %a\ | find "bytes free"
此时不应有 |。


在|线前加一个^。

O:\old\tool>for /f "tokens=3" %%a in ('dir /-c c:\') do set /a freesize=%%a/1048576
此时不应有 %%a。


%%a这种形式是用在批处理的,

作者: Climbing     时间: 2006-3-30 22:47
O:\old\tool>for %a in (c: d: e: f do @dir %a\ | find "bytes free"
此时不应有 |。


在|线前加一个^。

O:\old\tool>for /f "tokens=3" %%a in ('dir /-c c:\') do set /a freesize=%%a/1048576
此时不应有 %%a。


%%a这种形式是用在批处理的,在命令行下要用%a。

O:\old\tool>for /f "tokens=3" %%a in ('dir /-c c:\^|find "可用字节"') do set /a freesize=%%a/1048576
此时不应有 %%a。


这个与上一个是相同的问题。

thinks all


这应该是:thanks, all吧?