# MoveFileOrDirectory(string, string)

> Moves a file or a directory from a given path to another path.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void MoveFileOrDirectory(string source, string dest)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Remarks

This function's path is relative to the project root folder but it can also accept absolute paths.

All file separators should be forward ones "/".

Make sure to include the name of the files or directories at the end of the `dest` argument.

### Examples

```csharp
using UnityEngine;
using UnityEditor;

public class MoveFile : MonoBehaviour
{
    [MenuItem("Example/Move Something")]
    static void MoveSomething()
    {
        FileUtil.MoveFileOrDirectory("sourcepath/YourFileOrFolder", "destpath/YourFileOrFolder");
    }
}
```
