You can make a header file that would define some things like e.g. #define MAJOR_VERSION 2
and #define MINOR_VERSION 1
(same with build numbers and whatever you need there). Then, #include
this header file from your .rc
file.
Now, to the automation of the process. Your build script can output this header file, incrementing various values. After a successful build, the file is commited to VCS, and then can be used on next iteration. There are ways of accomplishing this even with plain .cmd
files, using environment variables, however, if you can, use something more sophisticated like perl/python etc. for this task.
This works fine for producing releasable builds, and it's not the best solution if you need to increment a build number on every build you make on your development machine.