未作测试,慎用。
;注意:回显截取只支持Run而不是RunWait
#include <Constants.au3>
Opt("MustDeclareVars", 1)
;RunWait(@ComSpec & " /c " & "cd D:\&start /w HH.exe -123 8.0 -456 " & IniRead($b, "bios", "1011", "00000000") & " -789 1&cls &ECHO %ERRORLEVEL%>D.TXT", "", @SW_HIDE)
Local $foo, $text, $iniread
If FileExists("xxx.ini") Then
MsgBox(0, 0, "inifile not found")
Else
$iniread = IniRead("xxx.ini", "bios", "1011", "00000000")
If Not @error Then
$foo = Run(@ComSpec & " /c" & " start /w HH.exe -123 8.0 -456 " & $iniread & " -789 1", "d:\", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($foo)
$text = StdoutRead($foo)
MsgBox(0, "STDOUT read:", $text)
FileWrite("output.txt",$text)
EndIf
EndIf
|