Getting the directory path of delphi exe?

Please discuss general Delphi programming topics here.

Getting the directory path of delphi exe?

Postby sekar1 » April 17th, 2008, 2:55 pm

hi,

i have a small question. is it possible to get the directory path in which deplhi exe running.

i will explain with small example:

i stored the deplhi exe of my project in c:\projects\dirpathretrivel\project.exe. if i run the exe, a message should appear that the exe is in "c:\projects\dirpathretrivel\" path.

is there any inbuilt command available to perform this operation or we need write function. if any command is not available means, please do help how to do this?
sekar1
Junior Member
Junior Member
 
Posts: 25
Joined: December 21st, 2006, 5:55 am

Postby HPW » April 17th, 2008, 6:04 pm

How about:

Application.ExeName or ParamStr(0)
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 236
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby geowink » April 17th, 2008, 8:15 pm

I use this function...

// Return the executable file path with or without trailing backslash.
function Exe_Dir( TrailSlash : Boolean ) : String;
begin
Result := Set_Path( ExtractFilePath(ParamStr(0)), TrailSlash );
end;

George
George
geowink
Junior Member
Junior Member
 
Posts: 37
Joined: November 29th, 2005, 3:59 am
Location: La Grange, Illinois


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron