Delphi: parent folder of executable


[ Delphi Forum -- by DelphiLand ]

Posted by webmaster Guido on November 06, 2003 at 18:10:37:

In Reply to: Need to find parent folder. posted by Ashraf El-Sayed on November 06, 2003 at 14:59:20:

: Hi. Sorry if this is a trivial question, but I am in my final year computing project, and making a fron-end for a dos-run application.
: What I need to know is where the .exe file is located. I need the full address. I could ask the user to type it in, but to find it automatically would give the user peace of mind.

: Thank you very much.
--------------------------

In Delphi, Application.ExeName gives the path plus filename of the executable.

Example:
In application "testprog" that is located in c:\test you code the following statement:

Label1.Caption := Application.ExeName;

This displays c:\test\testprog.exe


Related Articles and Replies:


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]