中国DOS联盟论坛

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-25 19:55
47,812 topics / 349,910 posts / today 0 new / 48,263 members
DOS批处理 & 脚本技术(批处理室) » [Solved] How to run two auto-execution batch files simultaneously?
Printable Version  3,901 / 11
Floor1 13792756609 Posted 2005-09-08 12:13
新手上路 Posts 2 Credits 7
How to write an automatic batch file to execute two already compiled batch files
Floor2 cheng059830 Posted 2005-09-08 20:20
初级用户 Posts 15 Credits 46
Floor3 JonePeng Posted 2005-09-08 21:04
金牌会员 Posts 1,883 Credits 4,562 From 广东广州
call a.bat
call b.bat
Floor4 willsort Posted 2005-09-22 19:22
元老会员 Posts 1,512 Credits 4,432
Re JonePeng:

This is executed one after another, not "simultaneously"; but I guess the "simultaneously" the original poster mentioned is this kind of simultaneous. To achieve approximate simultaneous execution, you must call programs in a multitasking environment. Therefore, in a pure DOS environment (meaning without loading any extension programs), it is impossible to achieve.

And under Windows, you can use start to call batch files to achieve polling-style "simultaneous" execution. I did some tests under XP, which is very interesting. Anyone who is interested can also test it and discuss the reason.

After downloading the attachment test.rar and extracting it, execute sp.bat in it, and then observe the execution result.

Attachments
MultiTaskTest.rar (232 bytes)
Floor5 13792756609 Posted 2005-09-28 07:25
新手上路 Posts 2 Credits 7
Thank you,各位 masters, for your help
Floor6 smileseeker Posted 2005-10-17 17:34
中级用户 Posts 83 Credits 316
D:\MultiTaskTest>sp.bat
5
start 1...
start 2...
start 3...
start 4...

D:\MultiTaskTest>end 2.

D:\MultiTaskTest>end 4.

D:\MultiTaskTest>
D:\MultiTaskTest>end 1.

D:\MultiTaskTest>
D:\MultiTaskTest>end 3.

D:\MultiTaskTest>
D:\MultiTaskTest>
D:\MultiTaskTest>
D:\MultiTaskTest>exit
exit
exit
exit




Puzzled
Floor7 smileseeker Posted 2005-10-17 17:42
中级用户 Posts 83 Credits 316
Remove the pause>nul inside. It's like this again.

D:\MultiTaskTest>sp.bat
5

D:\MultiTaskTest>start 1...
end 1.
start 2...

D:\MultiTaskTest>end 2.

D:\MultiTaskTest>start 3...
end 3.
start 4...

D:\MultiTaskTest>end 4.

D:\MultiTaskTest>

It seems that without removing pause>nul, batches 1-4 seem to execute simultaneously again.
Floor8 smileseeker Posted 2005-10-17 17:47
中级用户 Posts 83 Credits 316
Realize polling-style "simultaneous" execution??
Floor9 charlieko Posted 2005-10-18 10:23
初级用户 Posts 9 Credits 94
Of course, it's easy under WINDOWS. If it's under DOS, it's also feasible. But this requires using TSR technology.
Floor10 xutianyang Posted 2008-10-12 22:56
新手上路 Posts 1 Credits 2
Haha, it's fun. I also want to play~~~
Floor11 laxylj Posted 2008-10-26 09:56
新手上路 Posts 1 Credits 1
Study study study study study study
Floor12 cxyzss Posted 2008-11-20 16:49
新手上路 Posts 1 Credits 2
Remove the pause>nul inside. Still like this.

D:\MultiTaskTest>sp.bat
5

D:\MultiTaskTest>start 1...
end 1.
start 2...

D:\MultiTaskTest>end 2.

D:\MultiTaskTest>start 3...
end 3.
start 4...

D:\MultiTaskTest>end 4.

D:\MultiTaskTest>

It seems that without removing pause>nul, batch processing 1-4 seem to execute simultaneously again.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023