![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-24 06:47 |
47,812 topics / 349,917 posts / today 0 new / 48,274 members |
| DOS批处理 & 脚本技术(批处理室) » Understanding the interception function of variable characters in CMD |
| Printable Version 25,431 / 100 |
| Floor46 lxmxn | Posted 2007-06-17 13:30 |
| 版主 Posts 4,938 Credits 11,386 | |
|
RE bd123456789:
1. The effect of pause>nul is the same as the standalone pause command, except that it doesn't display the "Press any key to continue..." message. Here is the function of >nul. For a specific analysis, you can search for relevant discussion posts in the forum. 2. Refer to the following two links: Detailed Explanation of Variable Delay (Recommended for Newcomers) http://www.cn-dos.net/forum/viewthread.php?tid=28273&fpage=1 Under what circumstances should variable delay be used? http://www.cn-dos.net/forum/viewthread.php?tid=20733&fpage=1 |
|
| Floor47 bd123456789 | Posted 2007-06-24 07:08 |
| 中级用户 Posts 216 Credits 360 | |
|
Hehe, practical
Thank you very much! |
|
| Floor48 vk | Posted 2007-06-24 20:03 |
| 中级用户 Posts 86 Credits 218 | |
|
This thing is great. Already bookmarked. Thanks, LZ.
|
|
| Floor49 duanml | Posted 2007-06-24 23:29 |
| 中级用户 Posts 112 Credits 231 | |
|
It's of great help to newbies~
|
|
| Floor50 redrains | Posted 2007-09-28 11:54 |
| 初级用户 Posts 26 Credits 49 | |
| Floor51 ylgzs | Posted 2007-10-09 02:43 |
| 新手上路 Posts 10 Credits 17 | |
|
The LZ is really a good guiding teacher. Write more... (Don't beat me... Hehe)
|
|
| Floor52 james168 | Posted 2007-10-09 10:19 |
| 初级用户 Posts 35 Credits 81 | |
|
Got it. Thanks lxmxn!!!
|
|
| Floor53 06403213 | Posted 2007-10-20 02:05 |
| 初级用户 Posts 21 Credits 42 | |
|
It can also be passed like this!!!
|
|
| Floor54 fengjian | Posted 2007-10-31 18:06 |
| 新手上路 Posts 8 Credits 16 | |
|
Please allow me to raise a very basic question.
Moderator, after reading many of your posts, I can only say two words: "Admiration". I have just started to get in touch with this kind of thing and there are many things I don't understand. For example, I just demonstrated the one you posted earlier, but I can't understand what it means. I hope you don't laugh at me. I really hope to get everyone's help in future studies. Thank you |
|
| Floor55 lxmxn | Posted 2007-10-31 18:26 |
| 版主 Posts 4,938 Credits 11,386 | |
Originally posted by fengjian at 2007-10-31 18:06: In fact, this variable interception is equivalent to the substr function in other languages, which can intercept a substring at a specified position in a string. For example, if the first two characters of a string are what you want, then you can use variable interception to get the string you want. For example set string=cn.sina.com set new=%string:~0,2% Then the value of %new% is the first two characters of %string%, that is, "cn". |
|
| Floor56 z310394543 | Posted 2007-11-04 00:46 |
| 初级用户 Posts 23 Credits 48 | |
|
In a `for /l` loop in Windows batch scripting, the syntax `(start, step, end)` is used. For `(1,3,15)`: the `start` is 1, the `step` is 3, and the `end` is 15. It will iterate starting at 1, then add 3 each time, and stop when it reaches or exceeds 15. So it will generate values like 1, 4, 7, 10, 13, 16 (but 16 is over 15 so stops at 13). For `(1,4,15)`: the `start` is 1, the `step` is 4, and the `end` is 15. It will iterate starting at 1, then add 4 each time, and stop when it reaches or exceeds 15. So it will generate values like 1, 5, 9, 13, 17 (but 17 is over 15 so stops at 13). The first loop variable `%%a` takes on these values generated by the first `for /l` loop, and the second loop variable `%%b` takes on the values generated by the second `for /l` loop, and then each time it calls the `:printf` subroutine with `%%a` and `%%b` as arguments.
|
|
| Floor57 z310394543 | Posted 2007-11-04 00:49 |
| 初级用户 Posts 23 Credits 48 | |
|
Continuing from the previous part, it seems that the FOR below doesn't use the value of this variable? I don't understand it.
|
|
| Floor58 lxmxn | Posted 2007-11-04 09:59 |
| 版主 Posts 4,938 Credits 11,386 | |
|
RE z310394543:
1、(1,3,15) is used to control the variable %%i in the for loop, representing an arithmetic sequence, that is, a sequence starting from 1, increasing by a step of 3, but the maximum number is 15. 2、The variable var is used in the call sub - procedure, you can search for examples of call usage in the forum. |
|
| Floor59 z310394543 | Posted 2007-11-04 20:58 |
| 初级用户 Posts 23 Credits 48 | |
|
The efficiency of the moderator is really high
|
|
| Floor60 jk328019419 | Posted 2007-11-09 20:10 |
| 新手上路 Posts 3 Credits 6 | |
|
It simply didn't explain the usage. Those who know still know, and those who don't still don't.
|
|
| Prev 1 2 3 4 5 6 7 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |