禁止显示“按任意键继续”在批处理脚本中

发布于 2024-10-09 09:54:37 字数 77 浏览 0 评论 0原文

我正在写一个批处理脚本。在命令窗口中的一个阶段之后,它会显示“按任意键继续”并停止,按下某些按钮后脚本将继续。如何在脚本中防止这种情况发生?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你是年少的欢喜 2024-10-16 09:54:37

这是 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)

花之痕靓丽 2024-10-16 09:54:37

Pause>nul 会使其不回显“按任意键继续”。 。 .'

Pause>nul Will make it not echo 'press any key to continue . . .'

瞄了个咪的 2024-10-16 09:54:37

您可以从源代码调用其他类似的脚本,@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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文