Jump to content

Recommended Posts

Posted (edited)

Hello,

I've task as followed:

1. Console application (SomeApplication.exe) which runs file-comparer (fc.exe).

2. My AutoIt script have to get output of file-comparer and do some things in accordance to file-comparer output.

Problem:

when I run SomeApplication.exe from script as:

Run(@ComSpec & " /c " & $CmdLine[1], "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

I successfully get all output from SomeApplication.exe by StdoutRead but nothing from file-comparer

And on the other hand when I use $STDIO_INHERIT_PARENT flag as

Run(@ComSpec & " /c " & $CmdLine[1], "", @SW_SHOW, $STDIO_INHERIT_PARENT)
- I see all output in console (application and file-comparer) but can't access it neither by StdoutRead nor ConsoleRead (@error <> 0).

Could anyone please help me, if can ?

PS. Script compiled as Console. AutoIt ver:autoit-v3.3.6.1-sfx.exe

Edited by Good4U
Posted

I've found solution which works for me:

I used flags: $STDERR_CHILD + $STDOUT_CHILD + $RUN_CREATE_NEW_CONSOLE

in this case StdoutRead captures all data (SomeApplication.exe and fc.exe)

but still don't understand why it not works without separate console.

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
×
×
  • Create New...