I must be missing something really obvious, but for some reason, the command-line version of the Microsoft C++ compiler (cl.exe) does not seem to support reporting just its
Create a .c file containing just the line:
_MSC_VER
or
CompilerVersion=_MSC_VER
then pre-process with
cl /nologo /EP .c
It is easy to parse the output.