“@"是什么意思?在 Windows 批处理脚本中的意思 [英] What does "@" mean in Windows batch scripts
问题描述
我看到 @
用在这样的上下文中:
I saw @
is used in such contexts:
@echo off
@echo start eclipse.exe
@
在这里是什么意思?
推荐答案
表示不输出相应的命令.比较以下两个批处理文件:
It means not to output the respective command. Compare the following two batch files:
@echo foo
和
echo foo
前者只有 foo
作为输出,而后者打印
The former has only foo
as output while the latter prints
H:Stuff>echo foo
foo
(至少在这里).可以看出,运行的命令也是可见的.
(here, at least). As can be seen the command that is run is visible, too.
echo off
将为完整的批处理文件关闭此功能.但是,echo off
调用本身仍然可见.这就是为什么您会在批处理文件的开头看到 @echo off
.关闭命令回显和不要回显关闭它的命令.
echo off
will turn this off for the complete batch file. However, the echo off
call itself would still be visible. Which is why you see @echo off
in the beginning of batch files. Turn off command echoing and don't echo the command turning it off.
在更复杂的批处理文件中删除该行(或将其注释掉)通常是一个有用的调试工具,因为您可以在错误消息之前查看运行的内容.
Removing that line (or commenting it out) is often a helpful debugging tool in more complex batch files as you can see what is run prior to an error message.
这篇关于“@"是什么意思?在 Windows 批处理脚本中的意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!