简体   繁体   English

使用“ @”的批处理命令

[英]Batch Commands using “@”

What is the difference inbetween using @ instead of nothing before your commands? 使用@而不是在命令前不使用之间有什么区别?
The only difference I know so far is @echo off means "Don't Show Commands" and echo off means "Say off " 到目前为止,我知道的唯一区别是@echo off表示“不显示命令”, echo off表示“说off

If you don't start the batch script with @echo off , then every line of the script will be echoed to the command prompt as it's run. 如果您不使用@echo off启动批处理脚本,那么脚本的每一行都会在运行时回显到命令提示符。 This can be useful for logging or debugging. 这对于日志记录或调试很有用。

If echo is on, you can put @ before a command to keep that command from being echoed when it's run. 如果启用了echo,则可以在命令前放置@ ,以防止该命令在运行时被回显。

Beyond that, @ doesn't do anything else. 除此之外, @不会执行其他任何操作。

ECHO OFF 

will display "ECHO OFF" in command prompt and then turn echo off while 将在命令提示符下显示“ ECHO OFF”,然后在

@ECHO OFF

will not show any message and turn echo off. 将不显示任何消息并关闭回显。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM