Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Stop sending MSDOS output to AutoIT output window

$
0
0
I have a function that uses Run() to run a "nslookup" command and check to see if the address passed to it is reachable.

After invoking the Run() command, I use calls to StderrRead() to read nslookup's output.  I'm able to see the output, but it also displays in AutoIT's console output window (F8).

I would like to keep nslookup's output from showing up in AutoIT's output window because I use ConsoleWrite() to output progress messages.

I tried redirecting nslookup's output to a file, but nslookup complained.

Here is some test code:
_NS_Lookup("www.google.com")
Func _NS_Lookup($ip)
Local $ret, $str
$ret = Run("nslookup " & $ip , @SystemDir, @SW_HIDE, 4)
$str = ""
While 1
$str &= StderrRead($ret)
If @error Then ExitLoop
WEnd
If (StringInStr($str, "can't find " & $ip)) Then
$ret = False
Else
$ret = True
EndIf
Return ($ret)
EndFunc ;==>_NS_Lookup


Viewing all articles
Browse latest Browse all 12506

Trending Articles