|
hi,
i try to get the ip mask from my NIC but what if i have 2 NIC's? i get in my temp file 2 lines with subnet mask but if the first one is not that what i need, how can i go further to the second line?
this script is needed on aboud 500 computers so, i cant use it by nic name or by registry search because differents Nic's.
Her is my code to read the first line of the temp txt file:
Function IPConfig($IPType)
If NOT $IPLine
Shell '%comspec% /c ipconfig | find "$IPType" >$file'
If Open (1, $file, 2) = 0
$line = ReadLine(1)
If InStr($line, $IPType)
$IPLine = Trim(Split($line,':')[1])
EndIf
EndIf
EndIf
$X = Close(1)
Del $file
EndFunction
and the example of the output:
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Subnet Mask . . . . . . . . . . . : 255.255.240.0
this is at the moment in a test environment and normally needed for reading IP and if IP is same as IP from local DHCP server (not DHCP from ISP), get subnetmask from file
thanks in advance
Expodium
Edited by expodium (2004-07-18 12:31 PM)
|