I need to print into a text file the lines that appear in the cmd window when the batch is running. For instance, I have the following batch script:
copy D:\aaa.txt D:\bbb.txt
When I launch the batch file, the cmd window displays the following lines (sorry my Windows is in french):
D:\>copy D:\aaa.txt D:\bbb.txt
    1 fichier(s) copié(s)
I would like to automatically write these 2 lines in a text file in order to check the execution of more complex batch files and to track errors.

call mybatchfile.bat >>logfile.txt