XQGetOSVer is a very simple command line program that displays the current Operation System (OS) and some internal Windows version info.
It will return a number for each detected OS (Windows 95 up to Windows 7) and can therefore easily be used for batch files where you want to execute special commands depending on the OS in use.
You are also able to tell XQGetOSVer that you are only interested in some of the parts that Windows returns (e.g. Platform, Build, etc.).
With only 50 kB in size and no dependencies whatsoever, you can easily use it where ever you need it.