Jump to content

Recommended Posts

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...