Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

about CreateProcess API

Status
Not open for further replies.

zallen

Programmer
Aug 10, 2000
227
CN
Hi,friends
I want to use a DOS application and now i can use CreateProcess to run it.But i donot know how to get the output of this DOS program. Can i direct the output to a windows control,such as TMemo,etc.?

Any suggestion is appreciated!
zallen@cmmail.com
Long live of freedom!
 
What might work is output the dos command to a file
somthing like this 'doscommand >Outputfile.txt'
The read the output file to your memo control
 
Thanks !
But the redirection doesnot work when using CreateProcess directly.However it works when using a bat file to wrap the DOS program as below:

my_dos.bat
@echo off
my_dos.exe %1 > %2
....

I hope the simple way can be found!

Regards!
zallen@cmmail.com
Long live of freedom!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top