Windows批处理文件:如何启用命令的内联回显 [英] Windows batch file: how to enable inline echo of a command

查看:90
本文介绍了Windows批处理文件:如何启用命令的内联回显的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果默认情况下,Windows批处理文件中未启用echo,是否有办法针对特定命令将其内联"启用?我知道可以通过在命令前添加"@"来禁用特定命令的回显,但是有相反的方法吗?

If echo is disabled by default within a Windows batch file, is there a way to enable it "inline" for a specific command? I know that echoing of a specific command can be disabled by prepending "@" to the command, but is there a way to do the opposite of this?

例如,假设这样一个批处理文件:

For example, suppose a batch file like this:

@echo off
cmd1
cmd2
cmd3
:EOF

我如何强制回显上面的cmd2?

How could I force echo'ing of, say, cmd2 above?

推荐答案

您不能简单地通过@echo on开始批处理cmd2并通过@echo off结束批处理吗?

Can't you simply start your batch cmd2 by @echo on and end by @echo off?

这篇关于Windows批处理文件:如何启用命令的内联回显的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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