cmd.exe – CMD command – output to file – not working well

hope you could help me with this strange issue.
I have an EXE file that I run with this syntax:


<name of exe file> <name of specific test> <TRUEFALSE> <Iteration number>

** (details are not important here).

on each iteration, the file prints a line: “iteration #i”.
When I run the test, all the output is presented on the CMD window.

command: enter image description here

end of output:

enter image description here

As you may see, all 1000 iterations ran (0-999).
But, when I only add this to the command:

enter image description here

and try to get the exact same output in a file, it will always cut the X last iterations:

enter image description here

And the issue is consistent – if I want 100 iterations, it will get until ~64, for 10k iteration there will be 9996 prints, for 7000 it’s 6960, but never the amount I asked for.
It always misses the end for some reason. (But again, when the output is not to a file, but to the CMD window, all works great!)

Working on Windows 10.
thanks in advance for the helpers!