If you're running MS Windows targeted code you can call GetVersion() or GetVersionEx() for more info, and to identify the variant of Windows you are running on.
For more info scope out the MSDN info.
http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx