Run application and read its console output to string - interop

I have two applications: one written in Delphi6 is a main application, other written in C# is a plug-in exe module which outputs its result to console.
Could you provide some example of how to run this plug-in exe with CreateProcess and get it's console output to string or WideString ?

Creating a Child Process with Redirected Input and Output

Related

DOORS make console the interactive window

Is there any way to tell DOORS to use the current command prompt window as the interactive window when executing in batch mode?
For example, if I have hello.dxl which looks like
print("Hello world")
and Run.bat which looks like
"C:\Program Files\IBM\Rational\DOORS\9.6\bin\doors.exe" -u test -pass testPass -b hello.dxl -W
It currently opens a new window, prints "Hello World" and then closes the window (it closes it because of the -W). Is there any way to redirect this output to the command prompt window that was opened to run the batch file?
There is no console variant of doors.exe and as far as I know there is no possibility to give a sort of handle to a specific prompt window and use e.g. OLE Automation to print to this window, so, basically, no, it's not possible.
A workaround that we use for this requirement is to have a batch file which
generates the name to a temporary file ,
passes this file to DOORS as a parameter (using environment variables)
make DOORS/DXL cout to this file
after the DXL has finished, type the content of the temporary file in the calling batch and optionally delete it.
PS: according to https://www.ibm.com/mysupport/s/question/0D50z00006HIM4oCAH/doors-print-redirect-tutorial-for-print-cout-and-logfiles it apparently used to be possible to redirect STDOUT/STDERR to a specific file, but not in recent DOORS versions.

Use the standard output as log path

I need to run an external exe on windows machine, one of the arguments is a log path which the exe will write the progress info to
I would like to know if there is a way that i can make the external exe to write directly to the stdout instead of writing to a file
if I run the exe without any arguments it would not write anything to the stdout
There is no other argument that i could use

Redirect text file changes to batch file output

I am using a build tool which only writes its output to a text file, and I would like to use that build tool on a build server. The tool is Atmel Studio, and I try to start a build this way.
While the build is running, it writes its result to a text file, then the process of the tool ends.
I would like to have the text file output written to stdout, i.e. I would like the same effect as if the tool would write to the commandline output instead of the text file, in order to see what is going on during the build.
Is there any kind of command on a batch file to achieve this? If not, is there a good alternative?

Recognizing additional properties a vb6 app is launched with

If for example, after I compile myapp.exe with vb6, when I open it as
myapp.exe "something"
(from Run or something), is there anyway of knowing what "something" is when your application opens, so that the application can act differently with every value of "something"?
Sure, it's called a command line argument, and is returned by Command, as in :
Dim commandLineArgs As String = Command

How to execute a win32 console based executable programmatically and read the console output

I have a win32 console based .exe.
I want to execute this .exe from a win32 GUI application programmatically and read the console output.
e.g. c:\Test.exe is the location of the console based program and I want to execute this program from another GUI application.
output at the console could be a "string" with information.
I understand I can use CreateProcess to execute an application but how do I capture the output of the application.
Thanks
try redirecting the output to a text file test.exe >out.txt You can even but this line in a .bat file if you need it for some automatic testing.

Resources