Board index » delphi » Execute alf commandline or Execute with parameters!

Execute alf commandline or Execute with parameters!

Hi There
My problem is that I will execute a program (a game) with a command-line
like this -console.
Example:
ExecuteFile(hl.exe -console, '', 'C:\test', SW_SHOW);
But the hl.exe [-console] doesn't work.
Is there a other way to Execute a file with a parameter?
Thanks in advance...

Lasse Valeur
e.val...@get2net.dk
http://hjem.get2net.dk/Mr_Lz
----------------------------------------------------
There is place on the net you have to see:
http://pages.tca.net/roelof/setispy
http://setiathome.ssl.berkeley.edu
http://www.webwriter.dk
----------------------------------------------------

 

Re:Execute alf commandline or Execute with parameters!


Quote
"Lasse Valeur" <e.val...@get2net.dk> wrote in message

news:6idm5.302$n12.4889@news.get2net.dk...

Quote
> Hi There
> My problem is that I will execute a program (a game) with a command-line
> like this -console.
> Example:
> ExecuteFile(hl.exe -console, '', 'C:\test', SW_SHOW);
> But the hl.exe [-console] doesn't work.
> Is there a other way to Execute a file with a parameter?
> Thanks in advance...

There are several possibilities. Use the Windows API call CreateProcess, you
can use the WaitForSingleObject call after to have your program wait for the
called program to finish. Add ShellAPI to your uses clause and use
ShellExecute, also documented in the windows help file. There are also
several freeware components available.

Other Threads