Jump to content

ConsoleRead()


 Share

Recommended Posts

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
Link to comment
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...")
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...