What does “@” mean in Windows batch scripts

It means not to output the respective command. Compare the following two batch files:

@echo foo

and

echo 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 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.

Leave a Comment