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

  • 1
    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 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 '15 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 '15 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 '15 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 '15 at 2:37
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.

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

-1

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

  • 1
    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 :) – Mikey T.K. Mar 18 '16 at 19:52
-1

I installed Windows 10 (anniversary edition 1607) from scratch and the currentversion registry entry also reports 6.3, but, for example, 'ver' reports 10.0.14393

BTW 1) I read that the Windows 10 preview was 6.4

BTW 2) I installed Windows 10 as a Hyper-V VM on Windows Server 2012 R2, but I do not think that this has to do anything with it.

  • "I read that the windows 10 preview was 6.4" - You read wrong. This is a comment, it does not answe the author's question, if you wish to leave a comment earn the require reputation point to do so. – Ramhound Nov 1 '16 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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