运行多个bat文件,其中包含"暂停"

San*_*eep 7 windows batch-file

我有以下2个bat文件:

1.bat
------
//a line which does something
pause

2.bat
------
//a line which does the other something
pause
Run Code Online (Sandbox Code Playgroud)

现在,如何通过忽略暂停来在新的bat文件中运行这些bat文件?

jeb*_*jeb 14

简单:删除PAUSE!

但我认为,你对问题的一个限制可能是,你不能删除pause.

然后,您可以使用重定向到被调用的批处理文件.

就像是

call 1.bat < nul
call 2.bat < nul
Run Code Online (Sandbox Code Playgroud)

  • 我准备发布类似的东西,只是我会建议`ECHO(| 1.bat`,我实际上喜欢你的建议*更好*.无论如何,值得一提的是,如果批处理文件,这个技巧将会起作用不要读`stdin`(除了通过'pause`命令). (2认同)