path of executable

  1. 6 months ago

    Hi,

    how can i get the path of my own program?

    I.e. my program was started from 'c:\myprogram\program.exe'
    and i want to show the path in a messagebox.

    thx

    Hi all,

    thx for the fast answers.

    Problem solved.

    regards

  2. Andrew L

    19 Apr 2017 San Francisco, CA, USA

    Use the App.ExecutableFile property.

    e.g.

    MsgBox(App.ExecutableFile.NativePath)
  3. Dave S

    19 Apr 2017 San Diego, California USA

    per the lang ref

    Application.ExecutableFile
    Property (As FolderItem)
    The property is read-only.

    FolderItemValue = aApplication.ExecutableFile
    Returns a FolderItem for the actual executable application even if it is in a bundle.

    Notes

    Use the properties and methods of the FolderItem class to get/set attributes of the executable file and/or perform operations. For example:
    app.ExecutableFile.NativePath
    gets the full path to the executable.
    app.ExecutableFile.CreationDate
    gets the date/time the executable was created.

  4. see
    http://developer.xojo.com/app
    http://docs.xojo.com/index.php/Application
    http://docs.xojo.com/index.php/Application.ExecutableFile
    http://docs.xojo.com/index.php/FolderItem
    http://docs.xojo.com/index.php/FolderItem.NativePath

  5. Hi all,

    thx for the fast answers.

    Problem solved.

    regards

  6. Hi Andrew,

    Problem solved, but...

    MsgBox(App.ExecutableFile.NativePath)

    gives me the path + the name of the executable, but how
    do i get only the path (w/o the name of the executable)?

    regards

  7. Jeff T

    19 Apr 2017 Midlands of England, Europe

    http://docs.xojo.com/index.php/FolderItem.Parent

  8. Tim P

    19 Apr 2017 Pre-Release Testers, Xojo Pro ⭐️

    Please try searching the documentation at some point.

  9. Edited 6 months ago by hans h

    Hi Tim,

    i had a long day and laziness kicked in.

    But you're right.

    regards

  10. David C

    20 Apr 2017 Pre-Release Testers, Xojo Pro Derby, ITM

    Next time click the message that best answered it, rather than yourself. It helps the TLDR folks.

or Sign Up to reply!