[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'FileUtil' (#lazutils)

FindDefaultExecutablePath

Finds the default path to the named Executable file.

Declaration

Source position: fileutil.pas line 97

function FindDefaultExecutablePath(

  const Executable: string;

  const BaseDir: string = ''

):string;

Arguments

Executable

  

The name of the Executable file.

Function result

Returns the filename of the Executable file with path information attached.

Description

FindDefaultExecutablePath finds the default path to the named Executable file. On Windows systems, it looks for files both with and without the '.EXE' extension.

If Executable is not an absolute filename the executable is searched using the environment variable PATH. Relative directories in PATH are expanded using BaseDir.

On non-Unix systems (e.g. Windows), it searches in BaseDir as well. While on Unix systems (e.g. Linux, OS X) it only searches in BaseDir, if PATH contains the '.' directory.


Version 3.2 Generated 2024-02-25 Home