在批处理的新窗口中运行批处理文件?

Gen*_*ide 30 command window batch-file

我知道以前似乎已经问过,但是我需要一个批处理在新窗口中打开另一个批处理.我试过了:

start abc.bat

cmd abc.bat

run abc.bat
Run Code Online (Sandbox Code Playgroud)

和别的.他们都在同一个窗口打开,或者只是在新窗口中打开命令提示符,忽略我的批处理.是否有批处理命令在新窗口中打开批处理文件?

And*_*ris 39

这是你的追求吗?

start "New Window" cmd /c test.cmd
Run Code Online (Sandbox Code Playgroud)

  • 应该是接受的答案.谢谢 (5认同)

Ben*_*Ben 30

这有点奇怪,start abc.bat但是我认为这是因为你在另一批中间运行它.你可能需要call:

22:22:38.85 c:\help call
Calls one batch program from another.

CALL [drive:][path]filename [batch-parameters]
Run Code Online (Sandbox Code Playgroud)

给你start call abc.batcall start abc.bat取决于确切的问题.


小智 7

简单地做到这一点只是

start cmd /c "exampleexample.bat"
Run Code Online (Sandbox Code Playgroud)

这也适用于空格;

start cmd /c "example example.bat"
Run Code Online (Sandbox Code Playgroud)

和目录。

start cmd /c "C:\NAME\Example\Hi there\example example.bat"
Run Code Online (Sandbox Code Playgroud)

我用这个创建了我的通用批次,并且效果完美。