How to find Application's Running Path

Hi friends,
I want to know the Path of the running Application.
i.e the .Exe file's Path.
If I use GetCurrentDir(),it returns the path.
But if I open any files in some other directories from
the application on running,the the GetCurrentDir() function returns
the path of the recently opened file.

Can anyone tell me what is the function to get the
path of the running application(.Exe file).

Thanks a lot for your replies.

Comments

  • : Hi friends,
    : I want to know the Path of the running Application.
    : i.e the .Exe file's Path.
    : If I use GetCurrentDir(),it returns the path.
    : But if I open any files in some other directories from
    : the application on running,the the GetCurrentDir() function returns
    : the path of the recently opened file.
    :
    : Can anyone tell me what is the function to get the
    : path of the running application(.Exe file).
    :
    : Thanks a lot for your replies.
    :
    You want to get the path of the program you are running, or some other program?
    ParamStr(0) should give the path of the programs own exe-file.
  • : : Hi friends,
    : : I want to know the Path of the running Application.
    : : i.e the .Exe file's Path.
    : : If I use GetCurrentDir(),it returns the path.
    : : But if I open any files in some other directories from
    : : the application on running,the the GetCurrentDir() function returns
    : : the path of the recently opened file.
    : :
    : : Can anyone tell me what is the function to get the
    : : path of the running application(.Exe file).
    : :
    : : Thanks a lot for your replies.
    : :
    : You want to get the path of the program you are running, or some other program?
    : ParamStr(0) should give the path of the programs own exe-file.
    :

    try this: [code]extractfilepath(application.exename)[/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories