ReDFlaG Posted November 20, 2006 Share Posted November 20, 2006 hello, i launch a third party software via a button in a form $pid = Run(@ScriptDir &'\stuff.exe, '', @SW_HIDE, $STDERR_CHILD ) While 1 $temp &= StderrRead($pid) If @error Then ExitLoop Wend oÝ÷ ÚØb²è+-jH§Ê&zئzÊ"¦ëZaz¶î¶Ú'{h¶¢¹¬¢ØZ¶'éë,yزÚ)²Ø^¦º ëb¶ÇÉè¶Ú0¢¹yÆ®±ç¯zxÞ²ÈÛzk-«b«Þm¶ªºajwjºb¶¼vÚ%£«¶©®*+ܨ~Ø^¦ºz˺Ú"µÍØÙÜÔÙ][Ü]H ][ÝÜÝY^I][ÝËJB but it's not working. Can someone help? Thanks. Link to comment Share on other sites More sharing options...
MHz Posted November 20, 2006 Share Posted November 20, 2006 Try this $temp = '' $pid = Run('"' & @ScriptDir &'\stuff.exe"', '', @SW_HIDE, $STDERR_CHILD ) Do $temp &= StderrRead($pid) Until @error Your were missing a single quote in your code. Link to comment Share on other sites More sharing options...
ReDFlaG Posted November 21, 2006 Author Share Posted November 21, 2006 My bad, it was bad copy/past. But the issue is still the same: how to kill the processe (via a button in the GUI) while the process is still running and you are executing the loop? (it seems that i can't do anything while the prog is reading the stderr). By the way, your loop is nicer than the one i was using, i'll use yours now, thanks! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 21, 2006 Moderators Share Posted November 21, 2006 Spawn it using /AutoIt3ExecuteScript, keep track of the PID, and if it doesn't do what you want when you want, you can kill it in your GUI as you choose. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
MHz Posted November 21, 2006 Share Posted November 21, 2006 As SmOke_N suggests or use the peek flag of StderrRead.If StderrRead is called with a third argument other than zero, StderrRead will "peek at" the stream rather than actually reading from it, and return the characters that could be read from the stream. When run as a "peek" StderrRead always returns immediately. Note that any characters are still present on the stream after a peek and will be returned on the next read operation. Link to comment Share on other sites More sharing options...
ReDFlaG Posted November 21, 2006 Author Share Posted November 21, 2006 i'v done it like that: Do $temp = StderrRead($pid) $msg2 = GUIGetMsg() If $msg2 = $Stop Then ProcessClose ( "stuff.exe") ExitLoop EndIf Until @error and it's working. thanks. 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