Announcement

Collapse
No announcement yet.

Windows 11

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows 11

    Bonjour,
    How can i detect windows 11 whith :
    os_name = System.GetOSName()
    os name return is always win 10
    Thanks a lot

  • #2
    Hi Alain,
    You can't as M$ has stuffed up, but you can get correct version thru WMI with luacom plugin
    Click image for larger version

Name:	win11.png
Views:	179
Size:	6.4 KB
ID:	309022

    Code:
    -- Generated by ScriptOMatic Tool for AutoPlay Media Studio
    
    function Escape(v)
    if (v == nil) then return ""; end
    if (type(v) == "table") then return Table.Concat(v, ", "); end
    if (type(v) == "boolean") then
    if (v == true) then return "Yes"; else return "No"; end
    end
    return v;
    end
    
    local sOutput = "";
    local sOutputTitle = "Computer: localhost\r\n===================================== =====\r\n\r\n";
    local oWMIService = luacom.GetObject("winmgmts:\\\\localhost\\root\\CI MV2");
    local oColItems = oWMIService:ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", 48);
    if oColItems then
    local oEnum = luacom.GetEnumerator(oColItems);
    local oItem = oEnum:Next();
    while oItem do
    sOutput = sOutput .. "Caption: " .. Escape(oItem:Caption()) .. "\r\n";
    Label.SetText("Label1", sOutput);
    if (Dialog.Message("WMI Output", sOutputTitle .. sOutput, 1) == 2) then break; end
    sOutput = "";
    oItem = oEnum:Next();
    end
    else
    Dialog.Message("WMI Output", "No WMI Objects Found for class: Win32_OperatingSystem");
    
    end
    Cheers

    Comment


    • #3
      Try this MemoryEx solution as well, I'm curious if it will work. RtlGetVersion should yield the correct version number and does not require WMI.
      Attached Files
      Bas Groothedde
      Imagine Programming :: Blog

      AMS8 Plugins
      IMXLH Compiler

      Comment


      • #4
        Sorry Bas
        Click image for larger version

Name:	win11b.png
Views:	143
Size:	3.9 KB
ID:	309026 my Windows Click image for larger version

Name:	win11c.png
Views:	134
Size:	5.2 KB
ID:	309027
        Cheers

        Comment


        • #5
          Too bad! Was worth a shot

          Edit: if the build number >= 22000 then it is Windows 11, according to https://docs.microsoft.com/en-us/ans...s-version.html
          Bas Groothedde
          Imagine Programming :: Blog

          AMS8 Plugins
          IMXLH Compiler

          Comment


          • #6
            https://forums.indigorose.com/forum/setup-factory-9-5/setup-factory-9-modules-and-resources/307788-a-revised-system-getosname

            Ulrich

            Comment


            • #7
              Thanks a lot : Bas, Colc, Ulrich,

              https://forums.indigorose.com/forum/setup-factory-9-5/setup-factory-9-modules-and-resources/307788-a-revised-system-getosname

              do the job very well

              Alain

              Comment


              • #8
                It's not a life windows 11 is windows 10 look at many other under the hood code it's still code named windows 10 I used system tools that still report the newest versions of windows 11 as windows 10 nice script Ulrich
                Plugins or Sources MokoX
                BunnyHop 2021 Here

                Comment

                Working...
                X