Only today I noticed that there is another question unanswered:
and the line: @echo off, that removes extra spaces right?
It toggles the "default batch echo" state OFF, which is otherwise ON. Now to understand what the default batch echo does, take the following code:
What happens here is this:
echo on : this line will switch the echo state ON (unnecessary, it is ON anyway), and put out a message about the new state: ECHO is on
echo 1 : this will put out the string "1"
echo. : this will put out a empty line
echo 2 : this will put out the string "2"
: this will put out a prompt (C:\TestCopy\>) or similar
echo off : this will switch the default batch echo off, and put out a message about the new state: ECHO is off
echo 3 : this will put out the string "3"
echo : this will put out a message about the state of the default batch echo: ECHO is off
echo 4 : this will put out the string "4"
The output of that batch is very messy. Quite often I want to have empty lines in my code (for structuring) and I don't want to see the prompt echoed to the screen. That is why I have put "echo off" in the first line of the batch file in reply #3. If you remove the "@" sign from that batch you will still see the message "ECHO is off", because when the batch starts, the echo is on, and the first command will create some output. It switches the echo off for all the following lines, not for itself.
The "@" sign in front of any line switches the echo off for that particular line only. So in a batch with only one line you could write:
@for %%f in (myicon.ico, myieshortcut.url) do copy "C:\TestCopy\%%f" "C:\Documents and Settings\All Users\Desktop\TestCopy\datafolder"
and get the same effect (avoid messy output).