Best batch practice to run a second command with &&

好久不见. 提交于 2019-12-13 03:20:22

问题


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?


回答1:


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

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

You probably can use cmd directly:

cmd /c "command1 && command2"


来源:https://stackoverflow.com/questions/48458062/best-batch-practice-to-run-a-second-command-with

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!