Board index » delphi » How to execute another Program using Delphi Code

How to execute another Program using Delphi Code

Hi Folks,

I am currently writing an apllication that could be used as a job server.
The people from our company can post jobs to the job server using a job
client program.  For each job posted to the server, a job file is created

The jobserver then analyzes the files, and depending on the job, it should
start another application, using some parameters that are in the JobFile.
For example : converting a textfile using a conversion table, or something
like that.

Now I still need to program the last part of the application, and that is
where I have encountered some diffuculties.  The jobserver should be able
to execute a DOS command (mostly) or another Windows application (not so
frequent).  Now is my question : How can I execute a DOS command (eg :
Parse -infile Text.Txt -Conv Convert.con -Outfile Text.con).  In my
jobfiles, I have all the parameters needed for executing the DOS
command/batchfile, the only thing I have to know, is how I can execute a
DOS command (with parameters) from within my Delphi application.

If anybody could help me with that, I would really appreciate it.

Any comments or suggestions can be sent to my e-mail.

Thanks a lot in advance.  Greetings

--

Stefaan Lesage
Fotek nv; Belgium
Stef...@fotek.com

 

Re:How to execute another Program using Delphi Code


Quote
Stefaan Lesage wrote:
> How can I execute a DOS command (eg :
> Parse -infile Text.Txt -Conv Convert.con -Outfile Text.con).  In my
> jobfiles, I have all the parameters needed for executing the DOS
> command/batchfile, the only thing I have to know, is how I can execute a
> DOS command (with parameters) from within my Delphi application.

        If I understand your problem correctly, it sounds like all you need to
do is make a call to the Windows API function CreateProcess. The Delphi
help index seems to have a hard time finding the API calls in the help
files, but if you type CreateProcess and then hit F1 in the Delphi
editor, you'll get the help page that tells how to use it.
        Good Luck!

-Vince Vski

Re:How to execute another Program using Delphi Code


On Thu, 26 Jun 1997 16:50:14 -0400, Vince Vski

Quote
<Vince.Veselo...@gecits.ge.com> wrote:

Or you can use WinExec.

Quote
>Stefaan Lesage wrote:
[snip]
>do is make a call to the Windows API function CreateProcess. The Delphi
>help index seems to have a hard time finding the API calls in the help
>files, but if you type CreateProcess and then hit F1 in the Delphi
>editor, you'll get the help page that tells how to use it.
>    Good Luck!

>-Vince Vski

--
Paul Munn | http://www.munn.com/~pmunn | pmunn_x@munn_x.com | Remove _x to email.

Other Threads