====== Replace a string in a file with nant ====== File content: #include "stdio.h" #define VERSION "x.x.x.x" void main() { } Create replace.build file to replace version with $BuildNumber: Run it with: nant -buildfile:replace.build -D:version.file=version.cpp -D:BuildNumber=9.1.0.1