最佳批处理做法是使用&&"运行第二条命令 [英] Best batch practice to run a second command with &&

查看:133
本文介绍了最佳批处理做法是使用&&"运行第二条命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我想将两个命令发送到一个单独的窗口的情况下,我正在寻找最佳实践.如:

i'm looking for best practice in a situation where i want to send two commands to a separate window. as in:

start /wait command1 && command2

这有效,但是第二个命令不在新窗口中执行,而是在第一个任务完成后在初始窗口中运行.

this works however the second command is not executed in the new window instead runs in the initial window after the first task is finished.

如何正确处理这种情况?

how should a situation like this be handled correct?

推荐答案

您不能直接使用start进行操作,但是cmd支持使用引号:

You cannot do it directly with start but cmd supports that using quotes:

start /wait cmd /c "command1 && command2"

您可能可以直接使用cmd:

cmd /c "command1 && command2"

这篇关于最佳批处理做法是使用&&"运行第二条命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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