keilamym Posted October 28, 2005 Share Posted October 28, 2005 Can someone please tell me why my ping output is different at times. sometimes I get the workstation name and ip which is what I want, and sometimes I get the transmission time data.expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.1 (BETA) ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- #include <Constants.au3> #include <File.au3> #NoTrayIcon $file = FileOpen("sms2k3clientrepair_systems.inf", 0) ; --------Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $ping = Ping( $line ,250) Select Case $ping = 0 ;MsgBox(0,"here you go", "Error") _FileWriteLog(@TempDir & "\sms2k3clientrepair\SMS2K3ClientRepair.log", "Unable to ping " & $line & " - Ping Workstations") Case $Ping = 1 $run = Run(@ComSpec & " /c ping " & $line, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line2 = StdoutRead($run) If @error = -1 Then ExitLoop If StringInStr($line2, "Reply from") Then $temp = $line2 $temp = StringTrimLeft($temp,11) $temp = StringTrimRight($temp,2) ProcessClose("ping.exe") ; MsgBox(0,"here you go", $temp) _FileWriteLog(@TempDir & "\sms2k3clientrepair\SMS2K3ClientSuccess.log", $line & " " & $temp) ;_FileWriteLog(@TempDir & "\foundIPs.log", $line & " " & $temp) EndIf Wend EndSelect WendSAMPLE RESULTS2005-10-28 08:27:49 : REWW0102 162.87.109.209: bytes=32 time<1ms TTL=1272005-10-28 08:27:50 : REWW0038 162.87.68.1672005-10-28 08:27:50 : REWW0062 162.87.109.382005-10-28 08:27:50 : REWW0009 162.87.109.1512005-10-28 08:27:51 : REWW0058 162.87.109.1082005-10-28 08:28:15 : NTRL2497A 162.87.66.255: bytes=32 time<1ms TTL=1272005-10-28 08:28:18 : NTRL5076 162.87.64.2552005-10-28 08:28:23 : NTRW3515 162.87.33.852005-10-28 08:28:42 : NTRL5028 162.87.65.97Any assistance would be greatly appreciated Link to comment Share on other sites More sharing options...
w0uter Posted October 28, 2005 Share Posted October 28, 2005 try using StringRegExp My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Developers Jos Posted October 28, 2005 Developers Share Posted October 28, 2005 Can someone please tell me why my ping output is different at times. sometimes I get the workstation name and ip which is what I want, and sometimes I get the transmission time data.Any assistance would be greatly appreciatedI would first give Ping the time to generate its output before starting to process it. There a big chance now that not all data you need is there yet....... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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