OSVERSION

Forums Desktop Info OSVERSION

  • This topic has 4 replies, 2 voices, and was last updated 4 years ago by Maria.
Viewing 4 reply threads
  • Author
    Posts
    • #695
      CWeinhofer

        I have a question about the old OSVERSION versus the new method using a WMI call. In the previous version OSVERSION would just show “Windows 10 Home (64 bit)”, but the new WMI call shows “Microsoft Windows 10 Home (64 bit)”, which causes the end of the line to run off the screen. I know this comes directly from Win32_OperatingSystem, but is there a way to truncate this unneeded part, maybe with something like a user variable?

      • #697
        GlennGlenn
        Keymaster

          You can still get the old string from the registry using the REG item:
          HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProductName

        • #698
          CWeinhofer

            Thanks for the info.

            For the sake of others who might look at this post later — The REG key isn’t quite the same as the previous OSVERSION, as it omits the OS architecture. But I was able to create an exact match by combining two items with a user variable. Here’s the code for anyone that needs it:

            REG=active:2,interval:0,value:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProductName,wow:64,set:ProductName
            WMI=active:2,interval:0,namespace:root\cimv2,query:Win32_OperatingSystem,display:%OSArchitecture%,set:OSArchitecture
            TEXT=active:1,interval:0,style:b,text:OS Version,display:%ProductName% (%OSArchitecture%)

          • #700
            GlennGlenn
            Keymaster

              Thanks for the update. Nice work making use of the user variables to make it work.

              It’s interesting you get different results from the registry than I do. I guess that’s why I dropped the old one, it doesn’t always give the results you expect.

              • This reply was modified 4 years ago by GlennGlenn.
            • #736
              Maria

                I have windows 10 Pro installed and it shows this in the registry and when I run the WMIC os but desktopinfo.exe displays it as Windows 10 Enterprise, any idea why? Thanks for your assistance.

            Viewing 4 reply threads
            • The topic ‘OSVERSION’ is closed to new replies.
            Glenn's Page