更改暂停输出命令的批处理文件 [英] Change Output Of PAUSE Command In Batch File

查看:103
本文介绍了更改暂停输出命令的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有任何方式创建批处理文件code时,改变暂停命令的输出?

I was wondering whether there's any way to change the output of the PAUSE command when creating batch file code?

默认情况下,暂停命令将暂停脚本,并等待用户preSS继续之前的一个关键,显示默认的文本preSS任意键继续。有什么办法改变preSS任意键...文字的东西,我希望它告诉用户?

By default the PAUSE command will pause the script and wait for the user to press a key before continuing, displaying the default text "Press any key to continue . . ." Is there any way to change the "Press any key..." text to something I want it to tell the user?

感谢。 :)

推荐答案

您可以通过使用这个隐藏在暂停命令文本:

You could hide the text from the pause command by using this:

暂停> NUL

然后,你可以回应自己的消息告诉它已暂停用户:

Then you could echo your own message to tell the user it has paused:

回声批处理文件已暂停

所以,完整的脚本可能会是这样:

So the full script might look like this:

@echo off
echo Hello World!
echo The batch file has paused
pause >nul

希望这有助于:)

Hope this helps :)

这篇关于更改暂停输出命令的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆