禁止显示“按任意键继续”在批处理脚本中
我正在写一个批处理脚本。在命令窗口中的一个阶段之后,它会显示“按任意键继续”并停止,按下某些按钮后脚本将继续。如何在脚本中防止这种情况发生?
I am writing a batch script. After a stage in the command window it says 'press any key to continue' and halts, and after something is pressed the script continues. How can I prevent this in the script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是
PAUSE
命令的输出:http://ss64.com/nt /pause.html
PAUSE 的问题在于,当您从 Windows 资源管理器运行批处理文件时(或者您无法读取输出),它通常是必要的,但在命令提示符中却很烦人。我在这里询问了这个问题,有人建议我一个漂亮的技巧:
条件暂停 (不在命令行中)
That's the output of the
PAUSE
command:http://ss64.com/nt/pause.html
The problem with PAUSE is that it's often necessary when you run a batch file from Windows explorer (or you cannot read the output) but it's annoying in the command prompt. I asked about it here and I was suggested a nifty trick:
Conditional PAUSE (not in command line)
Pause>nul 会使其不回显“按任意键继续”。 。 .'
Pause>nul Will make it not echo 'press any key to continue . . .'
您可以从源代码调用其他类似的脚本,
@echo |调用otherScript.bat
请在此处找到详细答案另一个带有示例的线程
you can call other script like this from source,
@echo | call otherScript.bat
please find the detailed answer here Another thread with example