'What is the at sign (@) in a batch file and what does it do?
One remotely familiar with windows/dos batch scripting will recognize this line:
@echo off
For many-many days, I was happy with the sentiment that the @ is how echo off is meant to be written at the top of the batch and that's it.
However, recently I've came accross a line like this:
@php foo bar
and another line like this:
@call \\network\folder\batch.bat
This reinforced my suspicion that @ has more to it than just echo mode switching. However @ is not listed in the Windows XP: Command-line reference A-Z which I try to use as a reference and thus I'm not sure how to find definitive information on this:
What is the @ sign in batch, what's the terminology for it, and what does it do?
Solution 1:[1]
So in simple terms, Mostly imagine this, If we did @echo off, It would've shown echo off right?, Well with @ you can make it so it doesn't show it, Hope this helped!
Solution 2:[2]
Not only does the "at" symbol placed in the beginning hide the command, it can, for some commands, also be used to append command arguments stored in a text file. The syntax is exe @commands.txt. armclang.exe for example supports this option.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | JustAGuyWithAPC243 |
| Solution 2 | CivFan |
