Scripting 如何阻止脚本自动关闭?
我打开了一个.exe文件,但打开后脚本立即关闭。如何防止脚本关闭Scripting 如何阻止脚本自动关闭?,scripting,output,exe,executable,autoit,Scripting,Output,Exe,Executable,Autoit,我打开了一个.exe文件,但打开后脚本立即关闭。如何防止脚本关闭 Local $engine= "C:\Users\Davis\Desktop\chessEngine\stockfish-5-win\Windows\stockfish_14053109_32bit.exe" Run($engine, "", @SW_MAXIMIZE, $STDOUT_CHILD) 从Run()中删除$STOUT\u CHILD会使脚本在执行后保持打开状态,但我需要它来读取程序的输出。为什么会发生这种情况?这
Local $engine= "C:\Users\Davis\Desktop\chessEngine\stockfish-5-win\Windows\stockfish_14053109_32bit.exe"
Run($engine, "", @SW_MAXIMIZE, $STDOUT_CHILD)
从
Run()
中删除$STOUT\u CHILD
会使脚本在执行后保持打开状态,但我需要它来读取程序的输出。为什么会发生这种情况?这是一个如何从DOS命令获取输出的示例
Local $engine = "C:\Users\Davis\Desktop\chessEngine\stockfish-5-win\Windows\stockfish_14053109_32bit.exe"
Local $iPID = Run($engine, "", @SW_MAXIMIZE, $STDOUT_CHILD)
ProcessWaitClose($iPID)
ConsoleWrite(_getDOSOutput('ipconfig /all') & @CRLF)
Func _getDOSOutput($command)
Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
While 1
$text &= StdoutRead($Pid, False, False)
If @error Then ExitLoop
Sleep(10)
WEnd
Return StringStripWS($text, 7)
EndFunc ;==>_getDOSOutput