|
wzqaxue
新手上路

积分 18
发帖 8
注册 2008-9-26
状态 离线
|
『楼 主』:
关于echo的用法:批处理生成的bat文件老是少一个百分号
使用 LLM 解释/回答一下
echo for /L %%i in (1 1 10) do start cmd>>test.bat
我想把for /L %%i in (1 1 10) do start cmd填到test.bat里,可是实际上写到test.txt里的是for /L %i in (1 1 10) do start cmd,老是少一个%,请大侠指教,偶新手。
───────────────── 版务记录 ─────────────────
执行:HAT
操作:2008-10-10在帖子标题中增加搜索关键字;代码加code标签
说明:原标题"关于echo的用法"不利于论坛搜索
处罚:因属论坛新人,不予积分处罚
提示:建议阅读以下帖子
{1415}提问的智慧
{7326}论坛新手必读,所有人的基本行为准则
{22703}请不要做浮躁的人
{32667}那些连标题都写不清楚的人们啊,你们醒醒吧
{32825}本版严厉整顿烂帖
───────────────── 版务记录 ─────────────────
Last edited by HAT on 2008-10-10 at 05:43 ]
echo for /L %%i in (1 1 10) do start cmd>>test.bat
I want to put for /L %%i in (1 1 10) do start cmd into test.bat, but actually what is written into test.txt is for /L %i in (1 1 10) do start cmd, always missing a %, please give advice, I'm a newbie.
───────────────── Moderation Record ─────────────────
Performed by: HAT
Operation: Added search keywords to the post title on 2008-10-10; added code tags to the code
Explanation: The original title "About the usage of echo" was not conducive to forum search
Punishment: No score punishment due to being a forum newbie
Tip: It is suggested to read the following posts
{1415}The Wisdom of Asking Questions
{7326}Must-read for Forum Newcomers, Basic Code of Conduct for Everyone
{22703}Please Don't Be an Impatient Person
{32667}Those Who Can't Even Write a Clear Title, Wake Up
{32825}This Board Strictly Rectifies Poor-quality Posts
───────────────── Moderation Record ─────────────────
Last edited by HAT on 2008-10-10 at 05:43 ]
|
|
2008-9-26 00:36 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-9-26 01:01 |
|
|
radem
高级用户
    CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
|
2008-9-26 01:12 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-9-26 01:13 |
|
|
radem
高级用户
    CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
CMD用%%i
批处理中用%%%%i
In CMD, it's %%i. In batch processing, it's %%%%i
|

 |
|
2008-9-26 01:32 |
|
|
wzqaxue
新手上路

积分 18
发帖 8
注册 2008-9-26
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
难道是我的windows版本问题?明天我试试%%%%i 。
谢谢各位!
Could it be a problem with my Windows version? I'll try it tomorrow %%%%i. Thanks everyone!
|
|
2008-10-9 23:29 |
|
|
mimi820
初级用户
 
积分 35
发帖 20
注册 2008-10-2
状态 离线
|
|
2008-10-10 22:20 |
|
|
pkto
初级用户
 
积分 62
发帖 62
注册 2007-7-14
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
应该是要多加一个%的吧,特殊符号在批处理里面要定义的,比如“|”字符,如果想要输出,就要在前面加个“^”字符
It should be to add one more % character. Special symbols need to be defined in batch processing. For example, for the "|" character, if you want to output it, you need to add a "^" character in front.
|
|
2009-10-21 09:55 |
|
|
mwm5
初级用户
 
积分 40
发帖 23
注册 2009-10-15
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
Originally posted by radem at 2008-9-26 01:12:
%%%%i
nod
Originally posted by radem at 2008-9-26 01:12:
%%%%i
nod
|
|
2009-10-21 17:43 |
|