Windows – What does “@” mean in Windows batch scripts
batch-filewindows
I saw @ is used in such contexts:
@echo off
@echo start eclipse.exe
What does @ mean here?
Best Answer
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.
(Add -n to stop it trying to resolve hostnames, which will make it a lot faster.)
Note Dane's recommendation for TCPView. It looks very useful!
-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
Best Answer
It means not to output the respective command. Compare the following two batch files:
and
The former has only
foo
as output while the latter prints(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, theecho 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.