Topic: Pass Command Line

How is it possible to open an executable file and pass the command line to the program?

For instance:

"C:\Program\Executable.exe CommandLine"

OpenFile() doesn't seem to pass the command line.

Thanks

MAK

Re: Pass Command Line

example:

OpenFile('params','x.exe');
Dmitry.

Re: Pass Command Line

Hello Swgak

Let's say you want open tect file called readme.txt :

I use this script

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
OpenFile(ExtractFilePath(Application.ExeName) +'readme.txt');

or

OpenFile('notepad.exe','readme.txt');

end;

First way if readme.txt stands in my application folder.
Otherwise, if this file stays outside the folder, I can use OpenDialog event.

In two ways, it works fine

JB

Re: Pass Command Line

Great!!!

Thank you both Dmitry/Jean.

That's exactly what I was looking for

MAK