What is the at sign (@) in a batch file and what does it do?

后端 未结 2 930
别跟我提以往
别跟我提以往 2020-12-02 09:04

One remotely familiar with windows/dos batch scripting will recognize this line:

@echo off

For many-many days, I was happy with the sentime

2条回答
  •  死守一世寂寞
    2020-12-02 09:06

    At symbol - @

    The @ symbol tells the command processor to be less verbose; to only show the output of the command without showing it being executed or any prompts associated with the execution. When used it is prepended to the beginning of the command, it is not necessary to leave a space between the "@" and the command.

    When "echo" is set to "off" it is not necessary to use "@" because setting "echo" to "off" causes this behavior to become automatic. "Echo" is usually set to "on" by default when the execution of a script begins. This is the reason "@echo off" is commonly used, to turn echo off without displaying the act of turning it off.

    echo verbose
    @echo less verbose
    pause
    

提交回复
热议问题