coolity
-
Gesamte Inhalte
2 -
Registriert seit
-
Letzter Besuch
Beiträge erstellt von coolity
-
-
Hallo Zusammen,
ich hab ein vbs script das mir alles aktivierten IP Addressen ausliest. Ich benötige aber auch noch die Subnetz Maske das Default Gateway und eventuell noch die MAC Addresse.
Hier das Script:
public ip
public mask
function GetAllIP
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
ip = ip & IPConfig.IPAddress(i) & VbCrLf
Next
End If
Next
GetAllIP= ip
end function
function GetAllMask
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
mask = mask & IPConfig.SubnetMask(i) & VbCrLf
Next
End If
Next
GetAllMask= mask
end function
/Script
Ich kann zwar die IP Adressen auslesen aber bei der Subnet Mask bekomme ich immer folgenden fehler: Das Object unterstützt diese Eigenschaft oder Methode nicht.: 'IPConfig.SubnetMask' In Allip.vbs(GetAllMask) Line 28, column 12.
kann mir irgend jemand hierbei helfen?
Subnet Mask auslesen mit vbs
in Windows Forum — LAN & WAN
Geschrieben
hy,
damit umgehe ich ja aber das eigentliche problem. Oder nicht ?
Ist der QuellCode eigentlich soweit inordnung?
Weist du ob es das Object SubnetMask gibt in dieser class?
grüße