Running a MS-DOS program within a c++ program

Running a MS-DOS program within a c++ program

Post by Mike » Thu, 26 Jan 2006 12:39:19


Here is my problem. I want to run a specific DOS program from another
c++ program. This program is in a specific directory on my computer,
and i need to be able to have the user input the program to run. To do
this i'm using char arrays, and the string class. I've tried teh
system function, but it doesn't access specific directories, or at
least i haven't been able to get it to access specific directories. I
need help finding a way to run this second program within my c++
program. (The purpose for running the program is to copy a script into
a text file from that programs execution) any ideas, or further
questions for clarity, are welcome. Thanks in advance

Brune
 
 
 

Running a MS-DOS program within a c++ program

Post by Mike » Sat, 28 Jan 2006 12:22:49

CreateProcess does allow me to run the program as i desire to. My
question is, will I be able to output the results of the new process to
a file, as well as to the screen, or is this beyond the scope of that
function. I'm unfimiliar with how to use the handles, and how to
manipulate them for multiple outputs. Thanks for the direction so far.

Brune

 
 
 

Running a MS-DOS program within a c++ program

Post by Mike » Mon, 30 Jan 2006 00:20:31

thanks again, for now i'll continue looking into the createprocess()
function, see what i can do with these pipes.

Brune
 
 
 

Running a MS-DOS program within a c++ program

Post by Magnus Kri » Mon, 30 Jan 2006 21:59:22

This article may help you:

http://www.yqcomputer.com/