Sign in to follow this  
Followers 0
Swimming_Bird

Return from a Run?

3 posts in this topic

I'm building a GUI for a command line program. I was wondering if there was any way to read the output from this?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If the commandline app will pipe out to StdOut ok then can see it as ok. (Requires AutoIt Beta)

GUICreate('StdOut Sample for AutoIt Beta', 700, 500)
$edit = GUICtrlCreateEdit('', 20, 20, 660, 460)
GUISetState()
$stdout = Run(@ComSpec & ' /c help', '', @SW_HIDE, 2)
Global $all
While 1
    $data = StdOutRead($stdout)
    If @error Then ExitLoop
    If $data Then 
        $all &= $data
    Else
        Sleep(10)
    EndIf
WEnd
GUICtrlSetData($edit, $all)
While WinActive('StdOut Sample for AutoIt Beta')
    Sleep(250)
WEnd
Edited by MHz

Share this post


Link to post
Share on other sites

Thanks a lot, works perfectly :lmao:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0