Skip to content

Exepath

Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › Operating System Functions › ExePath

ExePath

Returns the folder that holds the running program.

Syntax

Declare Function ExePath ( ) As String

Description

Returns the path (the location) of the calling program. This is not necessarily the same as CurDir.

Return Value

A String variable set to the path of the running program.

Remarks

Usage

result = ExePath

Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Exepath.

Differences from QB

  • New to FreeBASIC

See also

Examples

Dim pathname As String = ExePath

Print "This program's initial directory is: " & pathname

Category: Operating System Functions
Kind: function


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally