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

Retrieves the name portion of a file path, including the extension.

For example, for `"c:/temp/take25.c3d"`, "take25.c3d" will be returned.

## Functional area

System

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getFileName "filePath"` |

### Arguments

> Macro (scroll-tablelayout)

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

### Flags

None

## Return value

string

Returns the name portion of a file path, including the extension. 

> Macro (scroll-pagebreak)

## Examples

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

# Additional information

## Related commands

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