8

On Windows 10, the VB.NET code Environment.OS.VersionString outputs Microsoft Windows NT 6.3.9600.0. According to Microsoft documentation, Windows 10's version number is 10.0, so why does VB.NET recognise Windows 10 as Windows 8.1?

I did systeminfo | findstr /C:"OS" in Command Prompt and it returned the correct value of 10.0.10240 N/A Build 10240 under "OS Version".

Dog Lover
  • 352
  • 1
  • 4
  • 15
  • 2
    Because it is picking up the fact you upgraded from Windows 8.1. The method you are using is looking at the registry. It is working as intended. There is a more appropriate function then using the environment variable to determine what operating system is being used. *I can't provide code since this isn't Stackoverflow* – Ramhound Aug 26 '15 at 01:12
  • 1
    Someone experienced the same problem in the comments here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx You need to update the manifest for your application. – MC10 Aug 26 '15 at 01:13
  • **You also are using it wrong.** This should be over at Stackoverflow since its a coding problem and although I suspect using the environment variable is still the wrong way to go about it, the manifest file, clearly isn't right. – Ramhound Aug 26 '15 at 01:16
  • @Ramhound Yes, I thought that might have been the case. I know that after a month of upgrading to Windows 10, Windows 8.1 is removed - does that mean the version number will be correct? – Dog Lover Aug 26 '15 at 02:34
  • The version number is correct. As I said he method your using is reading the registry, which wasn't updated, and wouldn't be updated unless it was a clean install of Windows 10. Go about this task a different way, in other words, don't use the environmental variable. – Ramhound Aug 26 '15 at 02:37
  • @Ramhound: It most definitely is not correct. After upgrading to Windows 10, you should have Windows 10, not Windows 8.1 ... Well, ok, so far the theory... – Quandary Mar 08 '16 at 15:49
  • @Quandary - Except the function, that was used, was working as intended. – Ramhound Mar 08 '16 at 17:29

4 Answers4

3

Because it is picking up the fact you upgraded from Windows 8.1. The method you are using is looking at the registry. It is working as intended. There is a more appropriate function then using the environment variable to determine what operating system is being used. I can't provide code since this isn't Stackoverflow

– Ramhound Aug 26 at 1:12

That's the answer in a nutshell. During the upgrade, the registry doesn't change the build number from the old to the new one. It just sticks.

Roke
  • 1,012
  • 1
  • 11
  • 31
0

So, to get back to the root question... I use Windows Management Instrumentation (WMI) to generate the Windows version number in the manner in which you are expecting. For example, it reports 10.0.10586

Here is a short code snippet

Public Class OS

' Use Windows Management Instrumentation (WMI) to get the OS version
    Public Shared Function GetOSVersion() As String
        Dim answer As String = ""

        ' add Imports System.Management and add a resource to System.Management
        Dim osClass As New ManagementClass("Win32_OperatingSystem")
        For Each queryObj As ManagementObject In osClass.GetInstances()
            answer = DirectCast(queryObj.GetPropertyValue("Version"), String)
        Next

        Return answer
    End Function
End Class
egray
  • 675
  • 4
  • 9
0

That's because you were reading CurrentVersion from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion and, as has already been said, that entry doesn't get updated change with Windows updates.

The entries to check are CurrentMajorVersionNumber, CurrentMinorVersionNumber and CurrentBuildNumber, in the same key.

Nuno André
  • 241
  • 2
  • 5
-2

6.3 is the internal version of Windows, which reveals that since Windows 7, there have not been any major releases, contrary to what Microsoft wants you to believe. The names Windows 7, 8, 10, etc. are just marketing names. They decided to skip 9 to match Mac OS X. But the real version number is 6.3

user319563
  • 27
  • 2
  • 2
    There are many different reasons floated for why they skipped v9 (a particularly neat one was that many legacy apps would see the 9 and mistakenly think the OS was Windows 95/98 - but I don't think they've ever confirmed or denied that). That said, try to refrain from random speculation in your answers - sources are best :) – Karu Mar 18 '16 at 19:52
  • This does not answer the question. _"6.3 is the internal version of Windows"_ - yes, but of Windows 8.1, and OP is getting it on Windows 10 and the question was why. The rest of the answer is an irrelevant rant. – gronostaj Jan 14 '22 at 08:46