如何让批处理文件等到另一个批处理文件完成执行? [英] How can I make the batch file wait until another batch file completes execution?

查看:135
本文介绍了如何让批处理文件等到另一个批处理文件完成执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使一个批处理文件等待另一个批处理文件完成?

How can I make a batch file wait until another batch file has finished?

例如,我有:

echo hi >r.txt
echo some piece of code >>r.txt 

start ar.bat

echo some piece of code >>ar.txt 

我希望start ar.bat之后的代码仅在ar.bat完成执行之后才能执行.我尝试了不使用start的情况,并且可以运行,但是我想在单独的窗口中运行ar.bat.

I want the code after start ar.bat to execute only after ar.bat finishes executing. I tried without start and it works, but I want to run ar.bat in a separate window.

有什么方法可以检查ar.bat是否已完成?

Is there any method to check whether ar.bat has finished?

推荐答案

使用call ar.bat完全通过批处理文件命令来完成此操作.

Use call ar.bat to do it completely with batch file commands.

使用start /wait ar.bat获取另一个窗口,然后等待它完成.

Use start /wait ar.bat to get another window and wait for it to complete.

这篇关于如何让批处理文件等到另一个批处理文件完成执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆