OSVERSION

Forums OSVERSION

This topic contains 4 replies, has 2 voices, and was last updated by  Maria 2 months ago.

  • Author
    Posts
  • #695 Reply

    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 Reply
    Glenn
    Glenn
    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 Reply

    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 Reply
    Glenn
    Glenn
    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 2 months, 1 week ago by Glenn Glenn.
  • #736 Reply

    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.

Reply To: OSVERSION
Your information:




Do NOT follow this link or you will be banned from the site!