Board index » delphi » Launching External Apps & Command Line Params

Launching External Apps & Command Line Params

How do I launch an external application?  Also, how do I read the command
line parameters when my delphi app is launched.....(ie myapp.exe
file.dat)....then my app does stuff with file.dat, how would I go about
this. thanks

 

Re:Launching External Apps & Command Line Params


In article <62m33s$...@news.multipro.com>
           rif2...@multipro.com "Ryan Rife" writes:

Quote
> How do I launch an external application?  

Look up winexec in the help files.

Quote
> Also, how do I read the command
> line parameters when my delphi app is launched.....(ie myapp.exe
> file.dat)....then my app does stuff with file.dat, how would I go about
> this. thanks

From within your application, you can look at the paramstr(x) array.

Paramstr(0) is the full path and file name of you app.
ParamStr(1) is the first command line parameter

Regards,

Mike Watson

Re:Launching External Apps & Command Line Params


Quote
"Ryan Rife" <rif2...@multipro.com> wrote:
>How do I launch an external application?  Also, how do I read the command
>line parameters when my delphi app is launched.....(ie myapp.exe
>file.dat)....then my app does stuff with file.dat, how would I go about
>this. thanks

WinExec is the simplest.
ExecuteFile is also possible.
CreateProcess is the most complecated and the most powerfull.

the ParamCount and ParamStr() functions give you parameters.
Greg Joy
j...@li.net

Other Threads