Announcement

Collapse
No announcement yet.

System.GetLANInfo() produces incorrect ip address

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

  • System.GetLANInfo() produces incorrect ip address

    Hi All,
    Been using System.GetLANInfo() to get lan.IP address which works OK as long as computer does not have VMWare installed!!

    Click image for larger version

Name:	ipconfig.png
Views:	71
Size:	43.6 KB
ID:	299579

    Yet when I use a VBScript it produces the correct IPv4 address as in pic
    Click image for larger version

Name:	vbs.png
Views:	54
Size:	5.9 KB
ID:	299580 Click image for larger version

Name:	TechTools v3.png
Views:	50
Size:	9.3 KB
ID:	299581

    Yet the MAC address is for the WiFi Adapter as per " mac = lan.NIC"
    I have been pulling my hair out trying to resolve this
    Any ideas would be welcome
    Cheers


  • #2
    What i know from what others have said it grabs the first in the list rather then grabbing the lan ip you want
    Plugins or Sources MokoX
    BunnyHop 2021 Here

    Comment


    • #3
      Hi Rex,
      No it's not the first that screenshot is actually the fourth and fifth adapter.Ethernet is disconnected, and there is another Vmware as well.
      The only adapter enabled is the wifi which AMS get's the Mac address of but pick's up the Vmware IP

      Comment


      • #4
        Are you not able to create a little VBS tool what is able to pass it back to AMS ?
        Plugins or Sources MokoX
        BunnyHop 2021 Here

        Comment


        • #5
          VBS is a problem that it cannot pass variable out ( from research that I followed up)
          How does your whatsmyip plug communicate with AMS is it C++

          Comment


          • #6
            Here is the VB code that I'm using

            Code:
            dim NIC1, Nic, StrIP, CompName
            
            Set NIC1 =     GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
            
            For Each Nic in NIC1
            
                if Nic.IPEnabled then
                    StrIP = Nic.IPAddress(i)
            
                    Set WshNetwork = WScript.CreateObject("WScript.Network")
                    CompName= WshNetwork.Computername
            
                   MsgBox "IP Address:  "&StrIP & vbNewLine _
                        & "Computer Name:  "&CompName,4160,"IP Address and Computer Name"
                
                    wscript.quit
                End if
            Next
            I was thinking along the lines of Luacom plug to GetObject but could not find an example to go on lol
            Tried with Scriptomatic also

            Comment


            • #7
              I think you can write to file from VB so you could wright a temp file and then delete it in AMS

              Also WhatsMyIP are remote IP's only it's 100% AMS/Lua
              Plugins or Sources MokoX
              BunnyHop 2021 Here

              Comment


              • #8
                just a idea but maybe using

                local getip = io.popen("ipconfig");
                local getip= handle:read("*a");
                getip:close();

                This should grab all the ip config data, and you can then cut it up and use it as much as you need
                Plugins or Sources MokoX
                BunnyHop 2021 Here

                Comment

                Working...
                X