如何使批处理文件等待直到另一个批处理文件完成执行? [英] how to make the batch file wait until another batch file completes execution?
本文介绍了如何使批处理文件等待直到另一个批处理文件完成执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使批处理文件等待另一批批处理完成?
How can I make a batch file wait for another batch finishing?
例如,我有:
echo hi >r.txt
echo some piece of code >>r.txt
start ar.bat
echo some piece of code >>ar.txt
启动ar.bat
才能在执行 ar.bat
后执行。我试过没有开始
和它的工作,但我想运行 ar.bat
在一个单独的窗口。是否有任何方法来检查 ar.bat
是否已完成?
I want the code after start ar.bat
to execute only after ar.bat
finished executing. I tried without start
and it works, but I want to run ar.bat
in a seperate window. Is there any method to check whether ar.bat
has finished?
推荐答案
使用调用ar.bat
可完全使用批处理文件命令。
Use call ar.bat
to do it completely with batch file commands.
使用开始/等待ar.bat
以获取另一个窗口并等待它完成。
Use start /wait ar.bat
to get another window and wait for it to complete.
这篇关于如何使批处理文件等待直到另一个批处理文件完成执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文