Sign in to follow this  
Followers 0
Qball

ConsoleRead()

3 posts in this topic

#1 ·  Posted (edited)

i have tried to use the ConsoleRead() function but i cant seem to get it to work

im using command prompt and yes i compiled the script as a console program

is it just not supposed to work for command prompt or is the command format different than other programs?

i used

do

$data = ConsoleRead()

until @error

ConsoleWrite("recieved:")

ConsoleWrite($data)

the consolewrite thing works but $data is always blank... please help =)

Edited by Qball

Share this post


Link to post
Share on other sites



@Qball....I am currently on 3.2.4.9 and I am using the following example from the help file and it works fine...

; Demonstrates StdoutRead()
#include <Constants.au3>

$foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
Wend

While 1
    $line = StderrRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")

Share this post


Link to post
Share on other sites

Example here of using ConsoleRead(). Compiled as CLI seems to work also.

:)

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