WoJ*_*WoJ 12 windows terminal powershell command-line cmd.exe
我需要运行两个永不终止的命令。我通常做的是
cmd终端并输入第一个命令cmd终端并输入第二个命令然后我让我的两个进程并行运行。
我现在想通过一个“启动”文件来自动执行此操作,该文件将启动上面的两个终端。它可以cmd基于 或 PowerShell。
注 1:我尝试使用cmdwith/k或/c但这不会产生新的终端。尝试类似的东西cmd /c cmd最终Internal Error在 shell 中输出。
注 2: PowerShell 有后台作业。问题是我想要两个单独的外壳,我可以监视输出(并最终使用Ctrl-C.
有没有办法在一个文件中实现这一目标?
App*_*ity 15
创建批处理文件:
start cmd.exe /c <first command>
start cmd.exe /c <second command>
Run Code Online (Sandbox Code Playgroud)
运行批处理文件,它将打开两个 cmd 窗口,批处理文件将退出。