<div class="meta" robots="noindex">

</div>

Method

# FolderItem.MoveFileTo

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2.1. Please use `FolderItem.MoveTo<folderitem.moveto>` as a replacement.

</div>

## Description

Moves the **FolderItem** to the path specified by *Destination*.

## Notes

It does a move rather than a copy even when the source file is on another volume. After the move, the original file no longer exists. See the example of <span class="title-ref">MoveFileTo</span> in the Examples section for FolderItem. Check LastErrorCode to see if an error occurred.

## Sample code

This example uses <span class="title-ref">MoveFileTo</span>. The source file will be deleted and moved into the destination folder.

``` xojo
Var f, g As FolderItem
f = FolderItem.ShowOpenFileDialog(FileTypes1.Text)
If f <> Nil Then ' if the user didn 't cancel..
  If f.Exists Then ' if it is a valid file...
    g = Volume(0).Child(f.Name)
    If g <> Nil Then
      f.MoveFileTo(g)
      MessageBox("success!")
    End If
  End If
Else
  MessageBox("File not found!")
End If
```

## Compatibility

All project types on all supported operating systems.
