> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/smb/renamefile.md).

# RenameFile

Task version: 2.2.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Smb/tree/main/Frends.Smb.RenameFile>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                   | Description                                                                                                          |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Path : `String`        | <p>Path to the file to be renamed.</p><p><br>Default: <code>-</code><br>Example: <code>folder\oldfile.txt</code></p> |
| NewFileName : `String` | <p>The new filename including extension.</p><p><br>Default: <code>-</code><br>Example: <code>newfile.txt</code></p>  |
| {% endtab %}           |                                                                                                                      |

{% tab title="Connection" %}

| Name                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Server : `String`      | <p>SMB server address or hostname.</p><p><br>Default: <code>-</code><br>Example: <code>127.0.0.1</code></p>                                                                                                                                                                                                                                                                                                                                                                                                             |
| Share : `String`       | <p>SMB share name to connect to.</p><p><br>Default: <code>-</code><br>Example: <code>testshare</code></p>                                                                                                                                                                                                                                                                                                                                                                                                               |
| Username : `String`    | <p>Username for SMB authentication.</p><p>This needs to be of format domain\username</p><p><br>Default: <code>-</code><br>Example: <code>WORKGROUP\Administrator</code></p>                                                                                                                                                                                                                                                                                                                                             |
| 🗝Password : `String`  | <p>Password for the SMB credentials.</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                         |
| OperatingSystem : `Os` | <p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><p>Possible values:</p><ul><li><code>Windows</code>: Defines the operating system of the SMB server.</li></ul><p>Options used to determine correct path separator to use.</p><ul><li><code>Linux</code>: Defines the operating system of the SMB server.</li></ul><p>Options used to determine correct path separator to use.</p><p><br>Default: <code>2</code><br>Example: <code>Linux</code></p> |
| {% endtab %}           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

{% tab title="Options" %}

| Name                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| RenameBehaviour : `RenameBehaviour` | <p>How the file write should work if a file with the new name already exists</p><p>Possible values:</p><ul><li><code>Rename</code>: How the file write should work if a file with the new name already exists</li><li><code>Overwrite</code>: How the file write should work if a file with the new name already exists</li><li><code>Throw</code>: How the file write should work if a file with the new name already exists</li></ul><p><br>Default: <code>2</code><br>Example: <code>RenameBehaviour.Throw</code></p> |
| ThrowErrorOnFailure : `Boolean`     | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                         |
| ErrorMessageOnFailure : `String`    | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p>                                                                                                                                                                                                                                                                                                                                                                                           |
| {% endtab %}                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| {% endtabs %}                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

## Task Result

| Name                       | Description                                                                                                                    |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean`        | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                             |
| NewFilePath : `PathString` | <p>Full path of the file after the rename operation.<br>Example: <code>Folder/SubFolder/document.txt</code></p>                |
| Error : `Error`            | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |

## Task Changelog

Changelog for Task Frends.Smb.RenameFile.

### \[2.2.0] - 2026-06-26

#### Changed

* Username parsing: now accepts a username without a domain instead of throwing an error.

### \[2.1.0] - 2026-04-23

#### Fixed

* Input parameters treated as normal string instead of PathString type.

### \[2.0.0] - 2026-04-08

#### Added

* New connection parameters that defined what servers Operating System.
* \[Breaking Change] Introduce PathString type that will represent paths with OS specific separators.

### \[1.0.0] - 2025-11-07

#### Added

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/smb/renamefile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
