Board index » delphi » Running a DOS program from within a DELPHI program

Running a DOS program from within a DELPHI program

I need to know how to run a DOS program from within a DELPHI 3.0
program.

The DOS program is written in FORTRAN and I only have the executable.
It will run in a DOS window under NT 4.0 and Windows 95.  

Without going into too much detail, the DOS program is widely used by
chemists for crystal structure analysis and I can't re-write it because
it is extremely complex and is practically an industry standard in its
current form.  The only problem is that it takes its instructions from a
text file and outputs its results to another text file.

Usually, the program is run from a DOS prompt as follows:

PROG INSFILE

where PROG is the program and INSFILE is the instruction file.

What is sorely needed is a Windows program that will allow the user to
easily create the instruction file and also interpret the results file.

So, the DELPHI program must allow one to set up instruction parameters
using dialog boxes and then hit a "RUN" button at which time an
instruction file is created and the DOS program is called.  the DELPHI
program waits for the DOS program to complete its task and then displays
data from the results file in an appropriate manner.

So, if you know how to call a DOS program with a command line parameter
from within DELPHI, I would appreciate hearing from you.

Thanks in advance,

Len Barbour

 

Re:Running a DOS program from within a DELPHI program


Quote
Len Barbour wrote:

> I need to know how to run a DOS program from within a DELPHI 3.0
> program.

> The DOS program is written in FORTRAN and I only have the executable.
> It will run in a DOS window under NT 4.0 and Windows 95.

> Without going into too much detail, the DOS program is widely used by
> chemists for crystal structure analysis and I can't re-write it because
> it is extremely complex and is practically an industry standard in its
> current form.  The only problem is that it takes its instructions from a
> text file and outputs its results to another text file.

> Usually, the program is run from a DOS prompt as follows:

> PROG INSFILE

> where PROG is the program and INSFILE is the instruction file.

> What is sorely needed is a Windows program that will allow the user to
> easily create the instruction file and also interpret the results file.

> So, the DELPHI program must allow one to set up instruction parameters
> using dialog boxes and then hit a "RUN" button at which time an
> instruction file is created and the DOS program is called.  the DELPHI
> program waits for the DOS program to complete its task and then displays
> data from the results file in an appropriate manner.

> So, if you know how to call a DOS program with a command line parameter
> from within DELPHI, I would appreciate hearing from you.

> Thanks in advance,

> Len Barbour

Look up WinExec in the help files. This is what I use and is pretty
straight forward.

-Mitch

Other Threads