dillonlim 0 Posted June 21, 2010 Wrote this while I was bored at work. Not quite sure what value it adds to the console traceroute if any. expandcollapse popup#include <Constants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Traceroute Thingy", 500, 500) GUICtrlCreateLabel("IP Address:", 10, 13, 60, 20) $ipaddress = GUICtrlCreateInput("", 80, 10, 200, 20) $start = GUICtrlCreateButton("TRACE", 300, 10, 80, 20) $clear = GUICtrlCreateButton("CLEAR", 400, 10, 80, 20) $display = GUICtrlCreateEdit("", 10, 40, 480, 420, $ES_READONLY) GUICtrlCreateLabel("Status:", 10, 473, 40, 20) $status = GUICtrlCreateEdit("Idle", 50, 470, 440, 20, $ES_READONLY) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $start Local $tracert = "" Local $st = 1 Local $tracestatus = "run" GUICtrlSetData($status, "Tracing route") $getip = GUICtrlRead($ipaddress) $troute = Run("cmd.exe /c tracert.exe -h 30 -w 10 " & $getip, "", @SW_HIDE, $STDOUT_CHILD) Do If $tracestatus = "run" Then $tracert &= StdoutRead($troute) If @error Then $tracestatus = "stop" EndIf EndIf $trace = StringStripCR($tracert) $tracesplit = StringSplit($trace, @CRLF) $arrayvar = UBound($tracesplit) If $st = $tracesplit[0] AND $tracestatus = "run" Then Sleep(500) ElseIf $arrayvar < 7 Then Sleep(500) ElseIf $st < $tracesplit[0] AND $arrayvar >= 7 Then $readchar = StringLeft($tracesplit[$st], 5) $cleanchar = StringStripWS($readchar, 8) If StringIsDigit($cleanchar) = 1 Then GUICtrlSetData($display, $tracesplit[$st] & @CRLF, 1) Sleep(1500) EndIf EndIf $st = $st + 1 Until $st = $tracesplit[0] AND $tracestatus = "stop" GUICtrlSetData($status, "Done") Case $msg = $clear GUICtrlSetData($ipaddress, "") GUICtrlSetData($display, "") GUICtrlSetData($status, "Idle") EndSelect WEnd GUIDelete() Share this post Link to post Share on other sites
JohnOne 1,603 Posted June 21, 2010 Been running for 10 minutes without any output, win 7 32 Also you might want to add an escape route from the Do...Until loop. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
dillonlim 0 Posted June 21, 2010 Sorry but I've never tried it on Win7. I only tested it on XP.Been running for 10 minutes without any output, win 7 32 Also you might want to add an escape route from the Do...Until loop. Share this post Link to post Share on other sites