异步运行Windows批处理文件命令 [英] Running Windows batch file commands asynchronously

查看:112
本文介绍了异步运行Windows批处理文件命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说,如果我有




  • foo.exe

  • bar.exe

  • baz.exe



如何以异步方式从批处理文件运行所有文件,

使用 START 命令运行每个程序应该会得到你需要的:

  STARTtitle[/ D path] [options]command[parameters] 


每个 START 调用运行其参数中给出的命令,并立即返回,除非使用 / WAIT 切换。



这适用于命令行应用程序。没有命令行的应用程序无论如何都会立即返回,因此,如果您想要异步运行,请使用 START


Say, if I have

  • foo.exe
  • bar.exe
  • baz.exe

How do I run all of them from a batch file asynchronously, i.e. without waiting for the previous program to stop?

解决方案

Using the START command to run each program should get you what you need:

START "title" [/D path] [options] "command" [parameters]

Every START invocation runs the command given in its parameter and returns immediately, unless executed with a /WAIT switch.

That applies to command-line apps. Apps without command line return immediately anyway, so to be sure, if you want to run all asynchronously, use START.

这篇关于异步运行Windows批处理文件命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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