vickerps Posted July 21, 2004 Posted July 21, 2004 Hi Guys I know about @IPadress1 But i also want Subnet and Gateway how can i get these
Davman Posted July 22, 2004 Posted July 22, 2004 This should do ya: ipconfig /all > c:\temp1.txt Will dump the result in C:\temp1.txt $filename = "C:\temp1.txt" $file = FileOpen($filename, 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 $line = FileReadLine($file) If @error = -1 Then ;Do what you like... EndIf if StringInStr($line, "Subnet") <> 0 Then ;You've found the line with "Subnet" in it, so parse this as you like EndIf if StringInStr($line, "Gateway") <> 0 Then ;You've found the line with "Gateway" in it, so parse this as you like EndIf Wend Something like that anyway, this is untested, so dont quote me on it. Sitting comfortably behind the code.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now