path of executable

  1. 4 days 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

    Apr 19 San Francisco, CA, USA

    Use the App.ExecutableFile property.

    e.g.

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

    Apr 19 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. Norman P

    Apr 19 Xojo Inc

    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

    Apr 19 Midlands of England, Europe

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

  8. Tim P

    Apr 19 Pre-Release Testers, Xojo Pro

    Please try searching the documentation at some point.

  9. Edited 4 days ago by hans h

    Hi Tim,

    i had a long day and laziness kicked in.

    But you're right.

    regards

  10. 3 days ago

    David C

    Apr 20 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!