rootx Posted November 9, 2022 Share Posted November 9, 2022 (edited) Hello everyone, I can't write to file the output, in the Autoit console though I can see it, nothing works. I have tried everything. At this point I need some help. Local $core = @ProgramFilesDir&"\myprogramX\core.exe" $run = RunWait($core & ' -m="'&$modules&'" -i="'&$ArrSource[$i]&'" -p="'&$Preset&'" -x="'&$configxml&'" -o="'&$output&'"',@ScriptDir,@SW_HIDE,$STDIO_INHERIT_PARENT) Edited November 10, 2022 by rootx Link to comment Share on other sites More sharing options...
rootx Posted November 10, 2022 Author Share Posted November 10, 2022 Hello, hola, hey, a little help! Thx😃 Link to comment Share on other sites More sharing options...
rootx Posted November 10, 2022 Author Share Posted November 10, 2022 (edited) Hi I figured out my problem, RunWait pauses the Autoit script until the process finishes consequently it doesn't read $STDERR_CHILD + $STDOUT_CHILD, so I would like to know how to directly read the output from the Autoit console by using RunWait and $STDIO_INHERIT_PARENT together. That's the only way I found, could you give me some advice to solve the problem? PS: with run and $STDERR_CHILD + $STDOUT_CHILD obviously works, but I need to process multiple files in a loop one at a time, which is why I need RunWait. Thx Edited November 11, 2022 by rootx Link to comment Share on other sites More sharing options...
rootx Posted November 11, 2022 Author Share Posted November 11, 2022 Does anybody have 1 minute to answer me, just let me know if it is possible? Thx Link to comment Share on other sites More sharing options...
Solution Gianni Posted November 11, 2022 Solution Share Posted November 11, 2022 ... so RunWait doesn't seem right for your purpose why not use "run" instead, so you can read the streams of your "core.exe" program and continue with the next file when the execution of a "run" is finished .... something like this ... (obviously not tested) For $i = 0 To UBound($ArrSource) - 1 $run = Run($core & ' -m="' & $modules & '" -i="' & $ArrSource[$i] & '" -p="' & $Preset & '" -x="' & $configxml & '" -o="' & $output & '"', @ScriptDir, @SW_HIDE, $STDIO_INHERIT_PARENT) While ProcessExists($run) ConsoleWrite(StdoutRead($run)) WEnd Next  rootx 1  Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
rootx Posted November 11, 2022 Author Share Posted November 11, 2022 I feel like a dummy... thanks a lot for your time Gianni PS: I also have another unresolved question.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now