+2  A: 

The compiler (cl.exe) has predefined macros __DATE__ and __TIME__, as well as __TIMESTAMP__. You can compile a file containing only these as a pre-link step.

Martin v. Löwis
wow, much easier. Very helpful.
Cheeso
A: 

Another alternative is to use the preprocessor to include the generated file:

#include "BuildTimeStamp.c"

The file that includes this file can be one of the files in the project under source control.

1800 INFORMATION