从批处理文件在新窗口中启动进程

Bru*_*uce 23 windows batch-file

我在windows中编写了一个批处理文件(.bat).我想在新窗口中执行特定的过程.我该怎么做呢?

a.py -s 3 -l 5
b.py -k 0  -> I want to start this in a new window and let the original batch file continue 
C:\program.exe
...
....
Run Code Online (Sandbox Code Playgroud)

And*_*ers 35

使用start命令:

start foo.py
Run Code Online (Sandbox Code Playgroud)

要么

start "" "c:\path with spaces\foo.py"
Run Code Online (Sandbox Code Playgroud)


Mec*_*ash 8

启动"title""C:\ path\to\file.exe"

我强烈建议插入一个标题,以便以后可以通过TASKKILL命令调用该标题.

TASKKILL /我的头衔

  • `TASKKILL/IM title`对我不起作用......或者不再起作用.我能找到的最接近的是"TASKKILL/FI"WINDOWTITLE等式标题"`,这只适用于设置标题实际上设置窗口标题的过程.它不适用于Windows应用程序,如notepad.exe. (2认同)