Jump to content

help me


Recommended Posts

A. Percy made a nice script that gives me (my network adapter + my MAC Address + My IP Address + and gateway IP)

but it gives me results in table i want it in msgbox can any 1 help me to do that for me please :">

1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Link to comment
Share on other sites

Hi

Had a go at your question..

It's not pretty , but it displays in a msgbox ... lol

$AdapterList = GetAdaptersList()
MsgBox(64,'Network Adapters List', $AdapterList)

Exit

Func GetAdaptersList( $ListAll = 0 )
    Local $aString, $SR, $Adapters
    If @OSTYPE = "WIN32_NT" Then
        ;Use WMI
        Local $o_WMIService = ObjGet( "winmgmts:\\" & @ComputerName & "\root\cimv2" )
        Local $Query = "SELECT Index, Caption, MACAddress, IPAddress, DefaultIPGateway FROM " & _
                        "Win32_NetworkAdapterConfiguration"
        If $ListAll = 0 Then
            $Query &= " Where IPEnabled = True"
        EndIf
        Local $o_Adapters = $o_WMIService.ExecQuery( $Query, "WQL", 0x30 )
        If IsObj( $o_Adapters ) Then
            Local $o_Adapter
            For $o_Adapter In $o_Adapters
                $Adapters += 1
                $aString &= "Index: " & $o_Adapter.Index &  @CRLF & _
                            "Adapter Name: " & $o_Adapter.Caption & @CRLF & _
                            "Real Mac Address: " & $o_Adapter.MACAddress & @CRLF & _
                            "IP Address: " & $o_Adapter.IPAddress(0) & @CRLF & _
                            "Default Gateway: " & $o_Adapter.DefaultIPGateway(0) & @CRLF & @CRLF  
            Next
            $SR = StringReplace($aString, "Index: ", "Total Network Adapters Detected: " & _
                                                        $Adapters & @CRLF & @CRLF & "Index: ", 1) 
        EndIf
    EndIf
    return $SR
EndFunc

Good luck

"N"

Cheers

Edited by smashly
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...