China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-20 05:16
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Understanding the interception function of variable characters in CMD View 22,963 Replies 100
Floor 16 Posted 2007-01-14 03:57 ·  中国 江西 赣州 电信
高级用户
★★
论坛上抢劫的
Credits 551
Posts 246
Joined 2006-09-21 12:35
19-year member
UID 63270
Status Offline
Thanks to brother lxmxn, it has been very helpful to beginners like us!
Floor 17 Posted 2007-01-14 04:22 ·  中国 山西 忻州 联通
初级用户
Credits 35
Posts 18
Joined 2007-01-14 01:18
19-year member
UID 76436
Gender Male
Status Offline
Passing by to learn, 3Q
Floor 18 Posted 2007-01-14 12:41 ·  中国 重庆 璧山区 电信
初级用户
Credits 58
Posts 31
Joined 2007-01-06 11:16
19-year member
UID 75621
Gender Male
From 重庆
Status Offline
Floor 19 Posted 2007-01-15 23:48 ·  中国 广西 桂林 电信
初级用户
Credits 20
Posts 8
Joined 2007-01-01 06:34
19-year member
UID 75166
Gender Male
Status Offline
It's too complicated, I can't understand. Can you add annotations to each line? How is the calling and looping process? Please tell me. As for CALL goto :eof, I can't understand this thing. Can you explain the call goto :eof? Thank you!
Floor 20 Posted 2007-01-16 04:39 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  The call can invoke some external commands and internal commands, and can also invoke the label segments within the batch processing program. Here, call :print means invoking the :print program segment below this batch processing program. In addition, the call can also call the batch program segment with parameters.

  goto :eof means jumping out of this label if it is inside a label, and if it is in other positions of the batch processing program, it means jumping to the end of the batch processing program, that is, exiting the batch program.
Floor 21 Posted 2007-02-02 08:06 ·  中国 湖北 武汉 电信
新手上路
Credits 16
Posts 7
Joined 2007-02-02 06:14
19-year member
UID 78397
Gender Male
Status Offline
Wonderful, learned something, thanks!
Floor 22 Posted 2007-03-04 22:14 ·  中国 湖北 武汉 电信
初级用户
★★
Credits 168
Posts 85
Joined 2005-08-26 00:19
20-year member
UID 41941
Gender Male
Status Offline
Wow, that's impressive! Need to study hard!
Floor 23 Posted 2007-03-04 22:42 ·  中国 四川 绵阳 江油市 电信
高级用户
★★★
Credits 502
Posts 327
Joined 2006-12-30 06:01
19-year member
UID 74981
Gender Male
Status Offline
With LZ's strength, he can definitely make another similar delay variable .bat. Eagerly looking forward to it.
Floor 24 Posted 2007-03-14 04:53 ·  中国 陕西 西安 电信
初级用户
Credits 120
Posts 45
Joined 2007-03-13 05:57
19-year member
UID 81568
Gender Male
Status Offline
In the batch command `echo\&pause&cls&echo.`, the backslash (`\`) here is just a literal character. In the context of a batch file, it doesn't have a special syntactic meaning like in some other programming languages. It's probably just part of the text that's being output or manipulated as part of the command sequence. So it's essentially just a character included in the string that the commands are dealing with.
Floor 25 Posted 2007-03-17 09:49 ·  中国 广东 茂名 电信
中级用户
★★
Credits 261
Posts 123
Joined 2006-06-06 19:23
20-year member
UID 56648
Status Offline
Wow, so powerful, really strong. Then it jumps back later, the loop is really well done.
Floor 26 Posted 2007-03-17 11:47 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Not bad. Favorite. Haven't studied this aspect in depth yet
Floor 27 Posted 2007-03-22 05:01 ·  中国 天津 电信
新手上路
Credits 12
Posts 5
Joined 2007-03-15 00:57
19-year member
UID 81751
Gender Female
Status Offline
echo %%var:~%1,%2%% The characters after interception are: !var:~%1,%2!
-------------------This sentence is not very clear. Can you explain it in detail?
Thank you~
Floor 28 Posted 2007-03-22 05:16 ·  中国 浙江 宁波 电信
初级用户
Credits 62
Posts 24
Joined 2007-03-17 09:34
19-year member
UID 82057
Gender Male
Status Offline
Newcomer, still some parts are not understandable
Floor 29 Posted 2007-03-22 07:51 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

Re tianlijian:
The symbols such as / and ; , . \ here have the same function, indicating to output an empty line.

Re star8289:
You can analyze its function in combination with the output of the code, where %1 and %2 represent the first and second command line parameters.
Floor 30 Posted 2007-03-25 10:06 ·  中国 四川 遂宁 电信
中级用户
★★
Credits 278
Posts 103
Joined 2006-10-21 21:08
19-year member
UID 67562
Gender Male
Status Offline
Can we make all batch commands into this kind of batch code with a demonstration function. But this is something that only experts can do. I hope someone interested will do this meaningful thing
Forum Jump: