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-08-02 15:30
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to not wait for the next command to execute? View 3,905 Replies 20
Original Poster Posted 2006-10-14 22:58 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 20
Posts 7
Joined 2006-10-14 21:35
19-year member
UID 65768
Gender Male
Status Offline
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 click
HereRead 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 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-10-15 20:58
Floor 2 Posted 2006-10-14 23:49 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
%WINDIR%\system32\notepad.exe
%~dp1\tuzi\ms2000.exe
第一高手 第二高手

Floor 3 Posted 2006-10-15 00:29 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 20
Posts 7
Joined 2006-10-14 21:35
19-year member
UID 65768
Gender Male
Status Offline
Floor 4 Posted 2006-10-15 04:10 ·  中国 重庆 璧山区 电信
中级用户
★★
Credits 235
Posts 109
Joined 2006-08-24 00:52
19-year member
UID 61161
Gender Male
Status Offline
Floor 5 Posted 2006-10-15 06:04 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  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?
Floor 6 Posted 2006-10-15 11:04 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
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
Floor 7 Posted 2006-10-15 18:33 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 20
Posts 7
Joined 2006-10-14 21:35
19-year member
UID 65768
Gender Male
Status Offline
Notepad.exe works, the second one doesn't
Floor 8 Posted 2006-10-15 19:28 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 20
Posts 7
Joined 2006-10-14 21:35
19-year member
UID 65768
Gender Male
Status Offline
Originally posted by lxmxn at 2006-10-15 06:04:

  The friends above 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... in the mobile hard disk...

Thanks.
The above problem has been solved, and now there is a new problem.
Please look at the top.
Floor 9 Posted 2006-10-15 19:28 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 20
Posts 7
Joined 2006-10-14 21:35
19-year member
UID 65768
Gender Male
Status Offline
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).
Floor 10 Posted 2006-10-15 20:40 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
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 :)

@ECHO OFF
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 ECHO %%I:\tuzi\ms2000.exe




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 ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 11 Posted 2006-10-15 20:41 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Originally posted by 6233nokia at 2006-10-15 19:28:
What does "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)" mean? I don't understand. Hehe

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.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +1 2006-10-15 20:53
Floor 12 Posted 2006-10-15 20:50 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
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 ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 13 Posted 2006-10-15 20:56 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
```
@echo off
START Jcb_zszq\TdxW.exe
START DZH5\internet\hypwise.exe
START UC\uc.exe
START 同花顺妙手回春至尊版\hexin.exe
START QQ+TM\CoralQQ.exe
```
Floor 14 Posted 2006-10-15 20:56 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by 6233nokia at 2006-10-15 19:28:

What does "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)" mean? I don't understand. Hehe



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 ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 15 Posted 2006-10-15 21:01 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 20
Posts 7
Joined 2006-10-14 21:35
19-year member
UID 65768
Gender Male
Status Offline
Originally posted by qwe1234567 at 2006-10-15 20:56:
@echo off
START Jcb_zszq\TdxW.exe
START DZH5\internet\hypwise.exe
START UC\uc.exe
START 同花顺妙手回春至尊版\hexin.exe
START QQ+TM\CoralQQ.exe


Thank you, boss... Correct answer... Finally got it done. Hahaha Give a hug.
Forum Jump: