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".

7
  • 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, 2015 at 1:12
  • 1
    Someone experienced the same problem in the comments here: msdn.microsoft.com/en-us/library/windows/desktop/… You need to update the manifest for your application.
    – MC10
    Aug 26, 2015 at 1: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, 2015 at 1: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, 2015 at 2: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, 2015 at 2:37

4 Answers 4

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.

1
  • 2
    In other words, the upgrade doesn't work properly... Well, nothing new in the west ;)
    – Quandary
    Mar 8, 2016 at 15:51
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
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.

-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

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, 2016 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, 2022 at 8:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.