如何从批处理脚本内运行一个批处理脚本 [英] how to run a batch script from within a batch script

查看:92
本文介绍了如何从批处理脚本内运行一个批处理脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何从一个批处理脚本中调用另一个批处理脚本?我希望它在如果语句执行。


解决方案

使用呼叫

  CALL nameOfOtherFile.bat

这将阻止(暂停)当前批处理文件的执行,它会等待,直到呼叫编一个操作完成。

如果你不希望它阻止,使用开始来代替。

使用 CALL /? START /?从CMD提示。

How do I call another batch script from within a batch script? I want it to execute in an if statement.

解决方案

Use CALL as in

CALL nameOfOtherFile.bat

This will block(pause) the execution of the current batch file and it will wait until the CALLed one completes.

If you don't want it to block, use START instead.

Get the nitty gritty details by using CALL /? or START /? from the cmd prompt.

这篇关于如何从批处理脚本内运行一个批处理脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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