How to append content to an existing log file without overwriting using windows command line?

append, cmd, file, logging, nant

Solution

Use `>>` to append, instead of `>`.

Problem

I have a batch file where I would like to append to the same log file, without overwriting, from two or more build files. I intend to write something like below: ``` SET logdir=C:\Logs\BuildLogFile.txt NAnt -buildfile:ServiceProxies.build > %logdir% SET logdir=C:\Logs\BuildLogFile.txt NAnt -buildfile:SecurityService.build > %logdir% ``` But the txt file gets overwritten. Is there any way by which I can append to the same .txt file because I want to use a single Log file for the entire project?

Original source