How can one determine what version of Windows and/or cmd.exe a batch file is running on?
There is no cmd /version
that I've been able to find and the results of SET in a command prompt session don't give anything obviously unique (between XP and Win7 anyway).
I found a shorter way using
ver
as well:This will find XP, replace the string with your wanted versions
Could be even shorter: