alza
asked on
Executing program with parameters
Hi,
I'm trying to execute an external program with the shellexecute API. The exteranal program needs rather a lot of parameters in order to run correctly however; i.e. c:\dir\progname.exe -para1 -para2 etc.
How can I do this in Delphi? Idealy my program will generate the parameters at run time.
Thanks,
BTW, the external program is xplanet - a you can find more information at http://xplanet.sourceforge.net. I'm attempting to create a small [simple] launcher for it.
I'm trying to execute an external program with the shellexecute API. The exteranal program needs rather a lot of parameters in order to run correctly however; i.e. c:\dir\progname.exe -para1 -para2 etc.
How can I do this in Delphi? Idealy my program will generate the parameters at run time.
Thanks,
BTW, the external program is xplanet - a you can find more information at http://xplanet.sourceforge.net. I'm attempting to create a small [simple] launcher for it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello and thank you to you both.
Slick812;
I've implemented a simple edit box where the parameters can be entered and then assigned to a string (SendParam). This seems to work fine at the moment.
bruintje;
I'm not entirley sure how and where the functions you've mentioned come into it. I've tried using paramstr(0) and this just returns the path of my compiled program...
Thanks,
Slick812;
I've implemented a simple edit box where the parameters can be entered and then assigned to a string (SendParam). This seems to work fine at the moment.
bruintje;
I'm not entirley sure how and where the functions you've mentioned come into it. I've tried using paramstr(0) and this just returns the path of my compiled program...
Thanks,
paramstr contains parameters that were used to run the current program, where paramstr(0) (the first one) contains the executable name.
look in the help for samples on paramcount and paramstr for this
HAGD:O)Bruintje