本文介绍了"@"代表什么? Windows批处理脚本中的意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到@用于此类情况:

@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批处理脚本中的意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 00:27