In general echo will print whatever is written beside it.
Ex:
Echo "I am the king"
Output:
I am the king
But putting a @ at the start of a line prevents the command on that line from being shown (echoed) on the screen.
@echo off
basically means that you give a "silent" command (with the @) to not show any future commands echoed on the Screen anymore - without it, any command executed in a batch file would be shown on the screen.
Example:
@echo off <-- prevents further commands from being 'echoed' to the screen
cd c:\windows <- change to the windows folder (you won't see any output of this!)
echo you are now in the windows folder. <-- this prints "You are now in the windows folder." on the screen
if you would leave out @echo off at the start, the screen would show the "cd c:\windows" on the screen as well. it would then also print the 'echo You are now in the windows folder.' command on the screen, followed by the printed text.
@ECHO OFF ensures that that the commands in your batch file are not printed; only their output is printed.
The "@" in front of ECHO OFF ensures that that command itself is not printed.
No comments:
Post a Comment