Du könntest es mal hiermit versuchen:
Spoiler anzeigen
;######################################################################################################
;# Function Name: _GetAllNetAdapterInfo()
;# Description:: Auslesen aller vorhandenen Netzwerkadapter und deren Konfiguration
;# Parameter(s): keine
;# Requirement(s): keine
;# Return Value(s): Erfolg Array[0][0] Anzahl der Adapter
;# Array[n][0] Adapter Name (wie in Systemsteuerung ==> Netzwerkverbindungen)
;# Array[n][1] Adapter Beschreibung
;# Array[n][2] IP-Adresse
;# Array[n][3] SubNetMask
;# Array[n][4] DHCP-Enabled (0/1)
;# Array[n][5] DHCP IP-Adresse
;# Array[n][6] DHCP SubNetMask
;# Array[n][7] DHCP Default Gateway
;# Array[n][8] DHCP Server
;# Fehler Array[0][0] Leerstring (kein Adapter vorhanden)
;# Author(s): Bitboy, nach einer Idee von BugFix ([email='bugfix@autoit.de'][/email])
;######################################################################################################
Func _GetAllNetAdapterInfo ()
Local $infoarr[1][9], $keyarr[1], $i=0, $x=0, $counter=0, $tmp, $tmp2, $short
;Registrierte Adapter zählen
While 1
$i = $i + 1
$tmp = RegEnumKey("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services", $i)
If @error <> 0 then ExitLoop
;Adapter sind in den einzigen Schlüsseln die mit "{" beginnen
If StringInStr($tmp,"{") Then
$short = 1 ;Merker zum Verkürzen der Schleife da Keys alphabetisch sortiert
$counter = $counter + 1
Redim $keyarr[$counter+1]
$keyarr[$counter] = $tmp ;Speichern der Adapterschlüssel
$keyarr[0] = $counter
Else
If $short = 1 Then ExitLoop
EndIf
WEnd
;Funktion verlassen wenn kein Adapter gefunden wurde
If $counter = 0 Then
$infoarr[0][0] = 0
Return $infoarr
EndIf
;Rückgabearray an Adapterzahl anpassen
Redim $infoarr[$counter+1][9]
$infoarr[0][0] = $counter
; TCP-Informationen auslesen
For $i = 1 to $counter
$infoarr[$i][2] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'IPAddress')
$infoarr[$i][3] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'SubnetMask')
$infoarr[$i][4] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'EnableDHCP')
$infoarr[$i][5] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'DhcpIPAddress')
$infoarr[$i][6] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'DhcpSubnetMask')
$infoarr[$i][7] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'DhcpDefaultGateway')
$infoarr[$i][8] = RegRead('HKLM\SYSTEM\CurrentControlSet\Services\' & $keyarr[$i] & '\Parameters\Tcpip', 'DhcpServer')
Next
;Adapternamen auslesen
$i = 1
$short = 0
While 1
$tmp = RegEnumKey("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}",$i)
If @error <> 0 then ExitLoop
$tmp2 = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\" & $tmp, "NetCfgInstanceId")
For $x = 1 To $counter
;Zugeordnete Verbindung auslesen
$infoarr[$x][1] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\' & $keyarr[$x] & '\Connection', 'Name')
If $tmp2 = $keyarr[$x] Then
$infoarr[$x][0] = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\" & $tmp, "DriverDesc")
$short = $short +1 ;gefundene Namen zählen
EndIf
Next
If $short = $counter Then ExitLoop ;Alle Adapternamen gefunden
$i = $i +1
WEnd
Return $infoarr
EndFunc ;==> _GetAllNetAdapterInfo
Sag bescheid obs schneller läuft ![]()