# MoveDirectory

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

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

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

| Name                      | Description                                                                                                                                               |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SourcePath : `PathString` | <p>Source path relative to the share where directory will be moved from.</p><p><br>Default: <code>-</code><br>Example: <code>documents/reports</code></p> |
| TargetPath : `PathString` | <p>Target path relative to the share where directory will be moved to.</p><p><br>Default: <code>-</code><br>Example: <code>backup/reports</code></p>      |
| {% endtab %}              |                                                                                                                                                           |

{% tab title="Parameter: 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>:</li></ul><p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><ul><li><code>Linux</code>:</li></ul><p>Defines the operating system of the SMB server.</p><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="Parameter: Options" %}

| Name                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IfTargetDirectoryExists : `DirectoryExistsAction` | <p>Specifies the action to take when a directory with the same name already exists in the target location.</p><p>Possible values:</p><ul><li><code>Throw</code>:</li></ul><p>Specifies the action to take when a directory with the same name already exists in the target location.</p><ul><li><code>Overwrite</code>:</li></ul><p>Specifies the action to take when a directory with the same name already exists in the target location.</p><ul><li><code>Rename</code>:</li></ul><p>Specifies the action to take when a directory with the same name already exists in the target location.</p><p><br>Default: <code>0</code><br>Example: <code>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 %}                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

{% tab title="Result: Result" %}

| Name                      | Description                                                                                                                    |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean`       | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                             |
| SourcePath : `PathString` | <p>The original path of the directory that was moved, relative to the share.<br>Example: <code>Projects\OldApp</code></p>      |
| TargetPath : `PathString` | <p>The new path of the directory after the move operation, relative to the share.<br>Example: <code>Archive\OldApp</code></p>  |
| Error : `Error`           | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |
| {% endtab %}              |                                                                                                                                |

{% tab title="Changelog" %}

## Changelog

### \[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-12-03

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
