本帖最后由 l4ever 于 2009-8-11 17:30 编辑
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("我的CMD", 700, 430)
$i1 = GUICtrlCreateInput("", 5, 5, 300, 20)
$b1 = GUICtrlCreateButton("Run", 315, 5, 50, 20)
$cmd = GUICtrlCreateEdit("cmd result is here" & @CRLF, 0, 30, 700, 400)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $b1
$command = GUICtrlRead($i1)
cmdping($command)
EndSelect
WEnd
Func cmdPing($var)
$vara = $var&">"&@TempDir&"\"&"Temp.txt"
RunWait(@ComSpec & ' /c "'&$vara&'"',"", @SW_HIDE)
$text = FileRead(@tempdir&"\Temp.txt")
GUICtrlSetData ($cmd,$text)
FileDelete(@tempdir&"\Temp.txt")
EndFunc |