potitpanda Posted June 10, 2008 Posted June 10, 2008 Hi I have this code and it's still not working on V3.2.12.0 Why CODE : #include <Constants.au3> ;Récupere le nom et l'IP du S1 $process_id = Run(@ComSpec & " /c nslookup.exe 127.0.0.1 ","", @SW_HIDE,$STDOUT_CHILD) $line = StdoutRead($process_id) if StringLen($line)>11 then $myarray = StringRegExp(StringLower($line),".*(w-013[0-9]{4}[a-z]-).*", 1) if (StringLen($myarray[0]) >10) then $S1_name=$myarray[0]&"1" ; Msgbox (0,"test",$s1_name) EndIf endif $process_id = Run(@ComSpec & " /c nslookup.exe "& $s1_name ,"", @SW_HIDE,$STDOUT_CHILD) $line = StdoutRead($process_id) if StringLen($line)>11 then $myarray = StringRegExp(StringLower($line),"172.*.*.162",1) if (StringLen($myarray[0]) >5) then $S1_ip=$myarray[0] ;Msgbox (0,"test",$s1_ip) EndIf endif With AU V3.2.10.0 this code works Thanks for the replies PotitPanda
rasim Posted June 10, 2008 Posted June 10, 2008 Try this: expandcollapse popup#include <Constants.au3> Global $myarray Dim $line ;Recupere le nom et l'IP du S1 $process_id = Run(@ComSpec & " /c nslookup.exe", "", @SW_HIDE, $STDOUT_CHILD) While 1 $line &= StdoutRead($process_id) If @error Then ExitLoop WEnd ConsoleWrite($line & @LF) If StringLen($line) > 11 Then $myarray = StringRegExp(StringLower($line), ".*(w-013[0-9]{4}[a-z]-).*", 1) If @error Then Exit If (StringLen($myarray[0]) >10) Then $S1_name=$myarray[0] & "1" Msgbox (0, "test", $s1_name) EndIf $line = "" $process_id = Run(@ComSpec & " /c nslookup.exe " & $s1_name , "", @SW_HIDE, $STDOUT_CHILD) While 1 $line &= StdoutRead($process_id) If @error Then ExitLoop WEnd If StringLen($line)>11 Then $myarray = StringRegExp(StringLower($line),"172.*.*.162",1) If @error Then Exit If (StringLen($myarray[0]) >5) Then $S1_ip=$myarray[0] EndIf Endif
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