Board index » delphi » Need to capture DOS (Console) output.

Need to capture DOS (Console) output.

Hello everybody,

I am currently writing a Windows Graphical User Interface (GUI) for a
Console application. Now I want to 'import' the output into the TMemo's Text
property, just like Winzip (6.0+) does when an error occures (or menu
'Options > View last output') with an external program (such as ARJ).

If anybody has any ideas, please share them with the world.

BTW: I know it can be done, because I can remember reading about it. But
unfortunatly I can't remember where. It could have been on the web or a
helpfile. URL's or helpfiles are also apprieciated.

When replying please CC (Carbon Copy) to: use...@athena.demon.nl

Thanks and greets, Marcel

___________________________________
Have you visited the Athena Delphi Page?
http://www.athena.demon.nl/

 

Re:Need to capture DOS (Console) output.


maybe will it work by adding a small parameter, something like this :
dir *.exe /on > listing.txt
or
dir *.exe /on >> listing.txt

Quote
> overwrites the existing file
>> appends to the existing file or create a new one.

R. Dullier AKA Shutting Down
Site 1 : http://www.lostzone.com/
Site 2 : http://users.skynet.be/shutting-down/
UIN : 993883 ( http://www.mirabilis.com/ )

Marcel de Haas a crit dans le message
<915569255.20190.0.spot.d4ee2...@news.demon.nl>...

Quote
>Hello everybody,

>I am currently writing a Windows Graphical User Interface (GUI) for a
>Console application. Now I want to 'import' the output into the TMemo's
Text
>property, just like Winzip (6.0+) does when an error occures (or menu
>'Options > View last output') with an external program (such as ARJ).

>If anybody has any ideas, please share them with the world.

>BTW: I know it can be done, because I can remember reading about it. But
>unfortunatly I can't remember where. It could have been on the web or a
>helpfile. URL's or helpfiles are also apprieciated.

>When replying please CC (Carbon Copy) to: use...@athena.demon.nl

>Thanks and greets, Marcel

>___________________________________
>Have you visited the Athena Delphi Page?
>http://www.athena.demon.nl/

Re:Need to capture DOS (Console) output.


<newsgroups snipped>

"Shutting Down" <sky40679.@.skynet.be>  wrote:

Quote
>maybe will it work by adding a small parameter, something like this :
>dir *.exe /on > listing.txt
>or
>dir *.exe /on >> listing.txt

This only captures STDIN, and won't capture error messages (normally
printed to STDERR).

There's a component by Martin Lafferty that launches a console app and
captures both STDOUT and STDERR. Very nice. I found it at DSP
(http://sunsite.icm.edu.pl/delphi/)> The filename is conseg.zip. You can
use it as is, or look at the source code and see what happens there.

.marek

--
General Frenetics, Discorporated: http://www.lodz.pdi.net/~eristic/
See URL for PGP public key (ADB5 A848 7871 1848 1BF4 919F D31A 61B2)

Re:Need to capture DOS (Console) output.


The Tip of the Week on Inprises site is about this topic. I haven't read it
myself, but you can get it from http://www.inprise.com/delphi/delzd.html

Christopher Latta

Quote
Marcel de Haas wrote in message

<915569255.20190.0.spot.d4ee2...@news.demon.nl>...
Quote
>I am currently writing a Windows Graphical User Interface (GUI) for a
>Console application. Now I want to 'import' the output into the TMemo's
Text
>property, just like Winzip (6.0+) does when an error occures (or menu
>'Options > View last output') with an external program (such as ARJ).

Other Threads