>>out_log.log 2>&1 copy /Y %1 somefile.txt
EDIT: Your example is legitimate syntax, it's just not often written with both redirections at the beginning. It's the same as this code:
copy /Y %1 somefile.txt >>out_log.log 2>&1
In the example below are two kinds of output - the
screen output and the
error output. They are both seen on the screen in normal use, but when redirecting output to a file you will get the screen output, but not the error messages.
They call these things streams, and STDOUT is the normal screen output while STDERR is where errors are generally written to.
STDOUT is represented by number 1
STDERR is represented by number 2
dir 1>>out_log.log 2>&1
The code above shows the DIR output being appended to the file
>>out_log.log and while I added the 1, you will always see the 1 on the console if you use
echo on with the batch file.
The portion
2>&1 shows that the STDERR stream (number 2) is being sent to the same place as number 1 (>&1) and number 1 has been set to go to the file
out_log.log.
So what the command does is send both the screen output and the error messages to the file
out_log.log.
You will never see >> in the 2>&1 syntax, it is always just one > character.
This example will send the DIR 1 output to the NUL device and it will disappear, and STDERR is being sent to stream 1 so it disappears also. No screen output will show at all.
dir >nul 2>&1
In this example the DIR output goes to the file, and all error messages are hidden.
dir >file.txt 2>nul
Lastly, there are 9 streams but 1 and 2 are the ones that are most often used in code.