---
title: "renameFile"
canonical: "https://support.appfire.com/space/PSCONF/15303371/renameFile"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | renameFile(path_to_source, path_to_destination) | **Package** | file |
> | **Alias** |  | **Pkg Usage** | rename(path_to_source, path_to_destination) |

## Description

> Macro (excerpt)
> 
> Renames a file.

Renames a file. Returns "true" if the file was renamed successfully and "false" otherwise. If "false" is returned check the log for a detailed reason on why it failed.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | path_to_source | String | Yes | Specifies the source file name. |
> | path_to_destination | String | Yes | Specifies the new file name for the source file. |

## Return Type

**Boolean (true/false)**

## Example

```
renameFile("C:/source.txt", "C:/destination.txt");
```

It returns 'true' if the **source.txt **file was renamed to **destination.txt**.

> ⚠️ It is recommended that you use forward slashes ( / ) for file paths.

## See also

> Macro (contentbylabel)