![]() |
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-08-02 16:45 |
48,038 topics / 350,123 posts / today 1 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » How to not wait for the next command to execute? |
| Printable Version 3,910 / 20 |
| Floor1 6233nokia | Posted 2006-10-14 22:58 |
| 初级用户 Posts 7 Credits 20 | |
|
Thanks. The previous problem has been solved,
Now there's a new problem::::::: Now a new problem has come, Suppose there are files in the mobile hard disk, and their respective paths are in h:\lin\Jcb_zszq\TdxW.exe h:\lin\DZH5\internet\hypwise.exe h:\lin\UC\uc.exe h:\lin\Tonghuashun Miaoshou Huichun Supreme Edition\hexin.exe h:\lin\QQ+TM\CoralQQ.exe I put the edited file a.bat, .\Jcb_zszq\TdxW.exe .\DZH5\internet\hypwise.exe .\UC\uc.exe .\Tonghuashun Miaoshou Huichun Supreme Edition\hexin.exe .\QQ+TM\CoralQQ.exe I put the edited a.bat file in the h:\lin directory. When I execute the a.bat command, To start the next program, I must close the program just opened above. How can I start the next program immediately after starting (that is, without waiting for the above program to close)? Simply put, how to not wait to execute the next command? If there are experts or more powerful methods, please add my QQ: 103794136. thx Previous problem: In the Windows environment, how to use a batch file to start multiple commands that can be started under Windows? I use a mobile hard disk. Every time I go to another new computer, the drive letter changes differently. The shortcut of the drive letter becomes invalid. So I hope the batch command can help. For example, originally in h:\tuzi\ms2000.exe I may change it to i drive on a new computer i:\tuzi\ms2000.exe I hope that as long as I execute the partial bat command on any new computer, it can be executed all, and I don't care about the change of the drive letter For example, I want to add the following commands in a.bat, (I put this command file on the C drive,) I hope to start these programs at once .WINDOWS\system32\notepad.exe .\tuzi\ms2000.exe One is Notepad, and the other is the rabbit program. I double-click the a.bat file and want to start the above two commands at the same time? How can I achieve it Regarding the version service record: Because the title is too vague? I think this one I changed should be okay now. I changed others. ──────────────── Version Service Record ──────────────── Execution: namejm Original title: Hope the batch command can help me Description: Because the title is too vague, it is not convenient for forum search and management. Please modify the title within three days. In addition, please do not use large fonts to post long posts to avoid wasting system resources. Prompt: To modify the title, click Edit at the bottom right of the current post, After modification, press Edit Post to be okay. Punishment: Because it is a new forum user, no punishment is temporarily given; if the title is not modified after three days, 4 points will be deducted, To show punishment, and the version owner will force the title to be modified. Please clickHereRead the forum posting regulations to avoid Future discussion of violating posts. ──────────────── Version Service Record ──────────────── [ Last edited by 6233nokia on 2006-10-15 at 19:26 ] |
|
| Floor2 fastslz | Posted 2006-10-14 23:49 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
%WINDIR%\system32\notepad.exe
%~dp1\tuzi\ms2000.exe |
|
| Floor3 6233nokia | Posted 2006-10-15 00:29 |
| 初级用户 Posts 7 Credits 20 | |
| Floor4 qq82015930 | Posted 2006-10-15 04:10 |
| 中级用户 Posts 109 Credits 235 | |
| Floor5 lxmxn | Posted 2006-10-15 06:04 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Several friends upstairs have misunderstood the LZ's meaning, right? His meaning might be that every time executing the a.bat file in the C drive, you can execute Notepad and the rabbit in the mobile hard disk, right? |
|
| Floor6 不得不爱 | Posted 2006-10-15 11:04 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
START notepad.exe
FOR %%I IN (C D E F G H I G K L M N O P Q R S T U V W X Y Z) DO START %%I:\tuzi\ms2000.exe |
|
| Floor7 6233nokia | Posted 2006-10-15 18:33 |
| 初级用户 Posts 7 Credits 20 | |
|
Notepad.exe works, the second one doesn't
|
|
| Floor8 6233nokia | Posted 2006-10-15 19:28 |
| 初级用户 Posts 7 Credits 20 | |
Originally posted by lxmxn at 2006-10-15 06:04: Thanks. The above problem has been solved, and now there is a new problem. Please look at the top. |
|
| Floor9 6233nokia | Posted 2006-10-15 19:28 |
| 初级用户 Posts 7 Credits 20 | |
|
The part `FOR %%I IN (C D E F G H I G K L M N O P Q R S T U V W X Y Z)` is a loop in a Windows batch script. It is used to iterate over each drive letter listed in the parentheses. Here, it's going to loop through each of the specified drive letters and for each drive, it will attempt to start the `%%I:\tuzi\ms2000.exe` program. But there are some obvious typos in the drive letter list, like the duplicate `G` and some incorrect formatting of the parentheses (should be normal parentheses `(` and `)` instead of the Chinese - style ones).
|
|
| Floor10 redtek | Posted 2006-10-15 20:40 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Enumerate the drive letters from C to Z in parentheses using the for command, and then execute them one by one through the do command: start loads the series of execution commands provided by %%I for the drive letter.
You can try to practice like this: The effect achieved by this series execution of for (ECHO only displays and does not execute) will be displayed, and then you will understand what it means :) For is associated with many knowledge points (loop, enumeration, execution, etc.). So, for /? is its help information. While looking at the help information, thinking and doing according to the examples on the help, Start from the simple ones to do, ) From now on: spend 2 hours to finish the basic practice of for, and then you will understand and be able to apply it more and more :) [ Last edited by qwe1234567 on 2006-10-15 at 21:01 ] |
|
| Floor11 不得不爱 | Posted 2006-10-15 20:41 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
Originally posted by 6233nokia at 2006-10-15 19:28: It means to set %%I in sequence as C D E F G H I G K L M N O P Q R S T U V W X Y Z and execute a specific command for each file in a group. FOR %variable IN (set) DO command %variable Specifies the replaceable parameter. (set) Specifies one or a group of files. Wildcards can be used. command Specifies the command to be executed for each file. command-parameters Parameters specified for the specific command. When using the FOR command in a batch file, use %%variable instead of %variable to specify the variable. Variable names are case-sensitive, so %i is different from %I. |
|
| Floor12 redtek | Posted 2006-10-15 20:50 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
If you execute a command directly on the DOS command line (instead of executing it within a batch processing .bat file), then the double percent sign %%i written in the batch processing file can be written as a single percent sign %, such as %i or %a, etc......
You try to practice like this (before practicing, first read the help of FOR /?) Open two DOS command windows, one is the FOR help information, and the other is for practice ) First, be familiar with most of the DOS internal commands and some of their simple parameters. ) Be familiar with SET and simple assignments ) Then start writing batch processing files ) Then study advanced FOR and if operations, so that you won't go the wrong way. )) If you go too fast at one step (learning speed is too fast), if you directly start to compile batch processing and fox and some more difficult batch processing scripts with many knowledge points, It is very likely that after a period of time, you will have to return to the most basic basics and learn again from the beginning... The most basic DOS commands and some knowledge of environment variables at the bottom can help you complete more complex and desired functions, And after being familiar with them, you can do whatever you want, just like the moderator is amazing~:) [ Last edited by qwe1234567 on 2006-10-15 at 21:02 ] |
|
| Floor13 不得不爱 | Posted 2006-10-15 20:56 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
```
@echo off START Jcb_zszq\TdxW.exe START DZH5\internet\hypwise.exe START UC\uc.exe START 同花顺妙手回春至尊版\hexin.exe START QQ+TM\CoralQQ.exe ``` |
|
| Floor14 redtek | Posted 2006-10-15 20:56 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
Originally posted by 6233nokia at 2006-10-15 19:28: No, this is too slow~ : ) From now on, you start learning to help and look at the SET environment variable and assignment (look at the help), then practice fox Then keep practicing until lunch time. If you don't finish, you are not allowed to eat lunch! Start now at 8:51, you must practice until 12 noon. If you don't finish, you can't eat~ : ) Report your progress and study situation every 15 minutes!!! (Must do it!) I just don't believe that you can be proficient in them by noon~! :~ : ) (Add 2 points to you now to show encouragement for your study!!! Come on!) [ Last edited by redtek on 2006-10-15 at 20:57 ] |
|
| Floor15 6233nokia | Posted 2006-10-15 21:01 |
| 初级用户 Posts 7 Credits 20 | |
Originally posted by qwe1234567 at 2006-10-15 20:56: Thank you, boss... Correct answer... Finally got it done. Hahaha Give a hug. |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |