Hi,
folgendes Script läuft unter der aktuellen Stable-Version, soweit so gut..
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <EditConstants.au3>
Global $strComputer=@ComputerName, $Zeichenhoehe=14, $GUIBreite=635
Global $i=0, $Index, $s=_GetMacs(False)
If $CmdLine[0]>0 Then $strComputer=$cmdLine[1]
#Region ### START Koda GUI section ### Form=D:\Sprachen\AutoIt3\Au3\kxf\GetMac.kxf
$AdapterAnzahl=$i
$EditHoehe=$Zeichenhoehe*$AdapterAnzahl
$GetMac=GUICreate('GetMacsW', $GUIBreite, $EditHoehe+24, 303, 250)
$lbTitel=GUICtrlCreateLabel('MacAdressen am ' &$strComputer, 2, 0, $GUIBreite-83, 17)
GUICtrlSetFont(-1, 9, 800, 0, 'Arial')
GUICtrlSetTip(-1, 'GetMacsW.au3 ©2012 by ytwinky, MD')
$cbxIPenabled = GUICtrlCreateCheckbox('IP enabled', $GUIBreite-72, -2, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$grpMain=GUICtrlCreateGroup('', 0, 10, $GUIBreite-1, $EditHoehe+14)
$efMac=GUICtrlCreateEdit('', 4, 20, $GUIBreite-8, $EditHoehe, BitOr($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_ReadOnly))
GUICtrlSetFont(-1, 9, 400, 0, 'Lucida Console')
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateGroup('', -99, -99, 1, 1)
GUISetState(@SW_SHOW)
$s=_GetMacs(True)
GUICtrlSetData($efMac, StringLeft($s,StringLen($s)))
#EndRegion ### END Koda GUI section ###
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $cbxIPenabled
GUICtrlSetData($efMac, _GetMacs(BitAnd(GUICtrlRead($cbxIPenabled), $GUI_Checked)))
EndSwitch
WEnd
Func _GetMacs($Bed=True)
Local $wbemFlagReturnImmediately=0x10, $wbemFlagForwardOnly=0x20, $wbemFlags=$wbemFlagReturnImmediately+$wbemFlagForwardOnly
Local $Items, $Item, $s='Keine WMI-Objekte gefunden für Klasse: Win32_NetworkAdapterConfiguration'
If $Bed Then
$Bed=' Where IpEnabled=True'
Else
$Bed=''
EndIf
$oWMISvc=ObjGet('winmgmts:\\' &$strComputer &'\root\cimv2')
If IsObj($oWMISvc) Then
$Items=$oWMISvc.ExecQuery('Select Index,IPAddress,MACAddress,Caption From Win32_NetworkAdapterConfiguration' &$Bed, 'wql', $wbemFlags)
If IsObj($Items) Then
$s=StringFormat('%5s%16s %s ', 'Index', 'IP-Adresse', 'MAC-Adresse') &' Beschreibung'
For $Item In $Items
With $Item
$Index=.Index
If .IPAddress(0)=@IPAddress1 Then $Index='*' &$Index
$s&=StringFormat('\r\n%5s%16s%18s', $Index, .IPAddress(0), .MACAddress) &StringMid(.Caption, StringInstr(.Caption, ']')+1)
$i+=1
EndWith
Next
EndIf
EndIf
Return $s
EndFunc
Da ich aber gem. Sig immer die aktuelle Beta (auch) benutze, mußte ich gerade feststellen: Da stimmt was nicht!
Habe ich einen Denkfehler und sehe den Fehler nicht? Oder hat die Beta einen Fehler?
Im Klartext: Die aktuelle Stable zeigt die Mac-Adressen an, die aktuelle Beta dagegen nicht..
Gruß
ytwinky