---
title: "getFileExtension"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737277/getFileExtension"
format: markdown
---
# Description

Retrieves the extension portion of a file path, excluding the dot. For example, for `"c:/temp/take25.c3d"`, "c3d" will be returned.

## Functional area

System

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getFileExtension "filePath"` |

### Arguments

> Macro (scroll-tablelayout)

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `filePath` | string | yes | Full path to the file to get the extension for. Be sure to use forward slashes instead of back slashes. |

### Flags

None

## Return value

string

Returns the file's extension.

## Examples

```plaintext
// Get the extension of a file path.
string $extension;
string $path = "c:/temp/take25.c3d";
$extension = `getFileExtension $path`;
print $extension;
```

> Macro (scroll-pagebreak)

# Additional information

## Related commands

- [getFileLocation](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736503)
- [getFileName](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738742)
- [getFileTitle](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737624)