#include #include $sCommands = "ipconfig /all" $iPID = Run(@ComSpec & " /c " & $sCommands, "", @SW_HIDE , $stdout_child) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd msgbox(0, '' , $sOutput) $aOutput = stringsplit($sOutput , @CR , 2) _ArrayDisplay($aOutput) $destinationfile = "c:\test\2.txt" for $i = 0 to ubound($aOutput) - 1 If stringinstr($aOutput[$i] , "target string") Then Filewrite($destinationfile , $aOutput[$i]) next