DOS批处理:强制回显单个语句?

发布于 2024-10-05 01:11:31 字数 111 浏览 5 评论 0原文

在我的 DOS 批处理文件中,当 echo 为 ON 时,我在执行之前使用“@”符号来抑制该语句的 echo。

当回显关闭时,我应该如何强制声明回显(我希望有另一个单个字符,但欢迎所有答案)?

In my DOS batch file, I use the "@" symbol to suppress the echo of that statement before execution when echo is ON.

How should I force the echo of a statement when echo is OFF (I'm hoping for another single character, but all answers welcome)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

又爬满兰若 2024-10-12 01:11:39

这是一个不如 @ 强大的解决方案:通过“echo on”然后“echo off”包围您想要回显的命令。

@echo on
your commands
@echo off

Here is a not as powerful solution as @ : surround the commands you want to echo by "echo on" then "echo off".

@echo on
your commands
@echo off
别闹i 2024-10-12 01:11:38

在我看来,没有办法。您可以将需要在 echo on@echo off 之间回显的命令包装起来,但我认为这很丑陋。另一种选择是保持 echo 开启 并对您不想回显的每个命令使用 @ 并在不使用 @ 的情况下保持可回显。

It seems to me that there is no way to do it. You can wrap commands you need to be echoed between echo on and @echo off but this is ugly, I think. Another option is to keep echo on and use @ for every command you don't want to echo and keeping echo-ables without @.

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