title: How to determine Windows Server 2016 version from registry
body: <p>I have an application that determines Windows Server version. It reads version value from <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion</code> registry key. It works well on Windows Server 2012, Windows Server 2012 R2 and returns 6.2 and 6.3 version as expected. However on Windows Server 2016 it still returns 6.3 even though I expected it to be 10.0. Was the correct registry key moved to some different place? Should I rely on this  registry entry at all? Here is a screenshot from Windows Server 2016:</p>
  
  <p><a href="https://i.stack.imgur.com/p3ZpH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p3ZpH.png" alt="enter image description here"></a></p>
  
  <p>I have an alternative way to use Environment.OSVersion. But I don't like it much because it requires me to specify explicitly in manifest the compatible windows versions and this means more maintenance work in the future.</p>