代码之家  ›  专栏  ›  技术社区  ›  MathuSum Mut

如何在批处理脚本中禁用输入?

  •  1
  • MathuSum Mut  · 技术社区  · 6 年前

    我需要禁止他们的批处理脚本查询输入,这意味着当他们的批处理脚本输出时: Press enter for step 2... ,我希望用户无法使用键盘与脚本交互,因此脚本看起来应该是冻结的。

    我如何从我的脚本调用他们的脚本,使用户无法与他们脚本的输入请求交互?

    1 回复  |  直到 6 年前
        1
  •  3
  •   double-beep hudson solomon    6 年前

    | (管道)操作员:

    echo Haha! You will not be able to press any key!! | their.bat
    

    这将重定向 STDOUT (标准失效)失控 echo Haha! You will not be able to press any key!! ( Haha! You will not be able to press any key!! )到 STDIN Standard Input )指挥权 theirs.bat .

    或者,甚至从 nul

    their.bat < nul
    

    https://ss64.com/nt/syntax-redirection.html What does "&&" in this batch file?