Anbei ein kleines Script um Dos Ausgaben auszugeben
_DOSOutput(Dos commando ,Name des Logfiles (Export in Window wird deaktiviert), Handle des GUICtrlEdit, left, top, length , high, Win Name)
Man kann damit Entweder in ein Edit Handle ausgeben oder ein Window erstellen lassen
oder direkt in ein Log File exportieren
#include <Constants.au3>
#include <GUIConstantsEx.au3>
Func _DOSOutput($command,$LogExportfilename='',$edithandle='', $win_left=-1,$win_top=-1,$win_lenght=500,$win_high=500,$win_name='Consolenausgabe')
Local $winexport, $Pid, $_getDOSOutput_windows
Local $text = ''
$err = 0
if $LogExportfilename = '' then
$winexport = 1
if $edithandle='' then
$_getDOSOutput_ownwindow = 1
$_getDOSOutput_windows = GUICreate($win_name, $win_lenght, $win_high,$win_left,$win_top)
Global $nEdit = GUICtrlCreateEdit('', 10, 10, $win_lenght-20, $win_lenght-20)
GUISetState()
$edithandle = $nEdit
EndIf
Else
$winexport = 0
$command = $command&' >'&$LogExportfilename
EndIf
$Pid = Run(@ComSpec & ' /c ' & $command, '', @SW_HIDE, $STDERR_MERGED)
StdinWrite($Pid, @CRLF)
StdinWrite($Pid)
While 1
$text = StdoutRead($Pid, False, False)
If @error Then
$err = 1
Else
GUICtrlSetData($edithandle, GUICtrlRead($edithandle) & $text)
EndIf
$text = StderrRead($Pid, False, False)
If @error And $err = 1 then
ExitLoop
Else
GUICtrlSetData($edithandle, GUICtrlRead($edithandle) & $text)
EndIf
$err = 0
WEnd
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
if $_getDOSOutput_ownwindow = 1 then
Exit
GUIDelete($_getDOSOutput_windows)
Else
Exit
EndIf
EndSelect
WEnd
Return $text
EndFunc