|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 31 楼』:
使用 LLM 解释/回答一下
RE qzwqzw:
已经修正过来了,不过这个"号对于其它的特殊符号(比如 ^ 、& 、| )起到了取消特殊用途的作用。所以感觉在用 set /a 命令时加上一对""比较保险。呵呵。
RE qzwqzw:
It has been corrected. However, this "character acts to cancel the special uses for other special symbols (such as ^, &, |). So it feels safer to add a pair of "" when using the set /a command. Hehe.
|
|
2007-6-27 01:51 |
|
|
vivi
新手上路

积分 18
发帖 7
注册 2007-6-12
状态 离线
|
『第 32 楼』:
使用 LLM 解释/回答一下
好东西,谢谢楼主,已经下载为DOC文档打印学习了。
Good stuff, thanks to the楼主. I have downloaded it as a DOC document and printed it for study.
|
|
2007-6-27 18:16 |
|
|
windowsxphao
初级用户
 
积分 25
发帖 14
注册 2006-11-2
状态 离线
|
『第 33 楼』:
感谢,学习ing
使用 LLM 解释/回答一下
:lol: This post is strong, worthy of the Party
|
|
2007-8-4 08:24 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 34 楼』:
使用 LLM 解释/回答一下
这确实一篇很有价值的文章,对于帮助理解cmd颇有帮助。
This is indeed a very valuable article, which is quite helpful for understanding cmd.
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-8-4 08:55 |
|
|
long626201
初级用户
 
积分 100
发帖 52
注册 2006-3-2 来自 云南
状态 离线
|
|
2007-9-3 10:51 |
|
|
flamemperor
初级用户
 
积分 66
发帖 29
注册 2007-9-6
状态 离线
|
『第 36 楼』:
使用 LLM 解释/回答一下
问一下这个:
! !
① 当启用变量延迟时,使用!!将变量名扩起来表示对变量值的引用。
我启动了变量延迟后用!!引用变量,不可以阿。
是不是还需要什么条件?
我比较笨,见笑了。
Ask about this:
! !
① When variable delay is enabled, enclosing the variable name with !! means referring to the variable value.
I enabled variable delay and used !! to reference the variable, but it didn't work.
Is there any other condition needed?
I'm relatively stupid, please forgive me.
|
|
2007-9-7 10:29 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 37 楼』:
使用 LLM 解释/回答一下
Re flamemperor:
你是用 Setlocal EnableDelayedExpansion 启动的吗?
请将你的代码发出来看看?
Re flamemperor:
Did you start with Setlocal EnableDelayedExpansion?
Please post your code for us to see?
|
|
2007-9-9 01:45 |
|
|
flamemperor
初级用户
 
积分 66
发帖 29
注册 2007-9-6
状态 离线
|
『第 38 楼』:
使用 LLM 解释/回答一下
谢谢斑竹的恢复,我已经解决问题了。
是我自己写错了,谢谢你。现在对变量延迟还是一知半解,继续学习中。
Thanks to the moderator for replying. I've already solved the problem. It was my own mistake. Thank you. Now I'm still a bit confused about variable delays, and I'll keep learning.
|
|
2007-9-14 13:56 |
|
|
wordexport
初级用户
 
积分 87
发帖 42
注册 2007-9-27
状态 离线
|
『第 39 楼』:
使用 LLM 解释/回答一下
还说什么呢!先顶吧
What else is there to say! Just top it first
|
|
2007-9-28 18:41 |
|
|
binggao
初级用户
 
积分 70
发帖 33
注册 2007-6-3
状态 离线
|
|
2007-9-30 09:12 |
|
|
002500
初级用户
 
积分 63
发帖 18
注册 2006-9-9
状态 离线
|
『第 41 楼』:
使用 LLM 解释/回答一下
在cn-dos 从来看帖不回贴 看到这个好帖 我觉得我的坏习惯的改一改了
I've always read posts without replying in cn-dos. Seeing this great post, I think I need to change my bad habit.
|
|
2007-10-3 14:14 |
|
|
reubon
新手上路

积分 4
发帖 2
注册 2007-10-4
状态 离线
|
『第 42 楼』:
使用 LLM 解释/回答一下
非感感谢lxmxn版主
受益匪浅!!!
Non-sense thanks to version master lxmxn
Benefited a lot!!!
|
|
2007-10-4 16:51 |
|
|
zwdeee
初级用户
 
积分 153
发帖 54
注册 2007-6-20
状态 离线
|
『第 43 楼』:
使用 LLM 解释/回答一下
正好看不懂,帮了我大忙
Just happened to not understand, it helped me a lot
|
|
2007-10-7 08:10 |
|
|
qdloverr
初级用户
 
积分 97
发帖 33
注册 2007-3-5
状态 离线
|
『第 44 楼』:
使用 LLM 解释/回答一下
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find /i "Physical Address"') do echo %%a>c:\MAC.txt
问题来了,'ipconfig /all^|find /i "Physical Address"'
既然是让 'ipconfig /all传输给下一个命令 为什么又用^这个符号来取消|的作用呢?
如果只运行'ipconfig /all^|find /i "Physical Address
可以不需要这个符号
为什么在for 里面一定要加上^
The `^` is an escape character. In a batch file, the `|` is a special character that has a specific meaning (pipeline operation). When using `|` inside a `for /f` command, it needs to be escaped with `^` so that the shell interprets it correctly as part of the command being passed to `find /i "Physical Address"` rather than as a special operator within the batch file's syntax itself.
So the translated text remains as the original batch code part:
```
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find /i "Physical Address"') do echo %%a>c:\MAC.txt
问题来了,'ipconfig /all^|find /i "Physical Address"'
既然是让 'ipconfig /all传输给下一个命令 为什么又用^这个符号来取消|的作用呢?
如果只运行'ipconfig /all^|find /i "Physical Address
可以不需要这个符号
为什么在for 里面一定要加上^
```
|
|
2007-10-7 12:41 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 45 楼』:
使用 LLM 解释/回答一下
RE qdloverr:
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find /i "Physical Address"') do echo %%a>c:\MAC.txt
如果不在 ipconfig /all 和 find 之间的|前加^的话,这条语句就可以理解成:
for /f "tokens=2 delims=:" %%a in ('ipconfig /all传值给 find /i "Physical Address"') do echo %%a>c:\MAC.txt
很明显会导致语法错误。导致这样情况,可能是因为管道符(|)的优先级比for命令中in后面的括号()的优先级高。
如果不加^的话,想办法使 ipconfig /all|find /i "Physical Address" 变成一个整体,或许可以这样:
for /f "tokens=2 delims=:" %%a in (' "ipconfig /all|find /i "Physical Address" "') do echo %%a>c:\MAC.txt
Last edited by lxmxn on 2007-10-7 at 06:03 PM ]
RE qdloverr:
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find /i "Physical Address"') do echo %%a>c:\MAC.txt
If you don't add ^ before | between ipconfig /all and find, this statement can be understood as:
for /f "tokens=2 delims=:" %%a in ('ipconfig /all is passed to find /i "Physical Address"') do echo %%a>c:\MAC.txt, which obviously leads to a syntax error. This may be caused because the priority of the pipe symbol (|) is higher than the parentheses () after in in the for command.
If you don't add ^, to make ipconfig /all|find /i "Physical Address" a whole, maybe it can be like this:
for /f "tokens=2 delims=:" %%a in (' "ipconfig /all|find /i "Physical Address" "') do echo %%a>c:\MAC.txt
Last edited by lxmxn on 2007-10-7 at 06:03 PM ]
|
|
2007-10-7 18:01 |
|