---
url: /flow/guide/scripting-reference/functions/file/extractfilepath.md
---

# ExtractFilePath

## Declaration

`Function ExtractFilePath( const FileName : string) : string`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := ExtractFilePath(Source.FileCon.CurrentFilename);
end;
```

## Description

Returns the drive and file path portion of a file path which includes a filename. Includes the trailing backslash at the end of the path. Returns blank string if no drive or directory is present in the input parameter.
