Link to home
Start Free TrialLog in
Avatar of Franker
Franker

asked on

running outside applications

I'm trying to set up an auto-run program for a cd that I'm creating for a friend.  I'd like to be able to access outside applications, ie Windows Explorer off of buttons.  I'm not sure how to do this, seeing as how I haven't been programming in Delphi very long.
Avatar of dwwang
dwwang

You can use WinExec('c:\...\ExeName',SW_SHOW);
Or CreateProcess or ShellExecute or ShellExecuteEx...
ASKER CERTIFIED SOLUTION
Avatar of philipleighs
philipleighs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Don't forget to add ShellApi to your uses clause.

Cheers,
Phil.

???
Hi dwwang,
What's up?
Avatar of Franker

ASKER

my other question with this is how can I detect where it's running from, for example I know in Java (the last language I was programming in) there's the command getDocumentBase() where you can retrieve the directory where the .java file is located.
Do you mean that you want to extract 'c:\mydir\' from 'c:\mydir\javafile.java'?
If so, use ExtractFilePath and add SysUtils to the uses clause.