Sounds like a job for a script file. Just write a batch file, or a C program to generate a batch file, containing commands like
cl prog.c define=prog1 /out:prog1.exe
cl prog.c define=prog2 /out:prog2.exe
(nb: I'm not sure what the command line syntax for defines is) then in the code for prog1.exe you use a #ifdef prog1/#endif block etc.
Or you could make it more complex, for each variation in code you can have
#else if variation1b
then in the script file:
cl prog.c define=variation1a define=variation2a define=variation 3a /out:prog1.exe
cl prog.c define=variation1a define=variation2b /out:prog2.exe
etc. Basically you can make it as complicated as you want.