The FolderItem class can represent any file or folder on the machine. To create a FolderItem instance for a particular absolute path, pass the path to the GetFolderItem method and store the result:
Dim SourceFile As FolderItem
SourceFile = GetFolderItem("C:\ExampleFolder\ExampleFile.txt", PathTypeAbsolute)
Once you've constructed the FolderItem you can modify its properties and call its methods to affect changes to the underlying file or directory.
To copy or move a file to another directory, you need to acquire a FolderItem representing the destination directory. Depending on the destination, you can use one of several methods to acquire the destination FolderItem.
For example,
Dim destination As FolderItem
destination = GetFolderItem("C:\DestinationExample\", PathTypeAbsolute)
or, using the SpecialFolder module:
destination = SpecialFolder.Desktop 'the user's desktop directory
or, using the parent folder of the ExecutableFile property of the App class:
destination = App.ExecutableFile.Parent 'your app's directory
Once you have both the source and destination FolderItems set up, simply call the CopyFileTo or MoveFileTo methods of the source FolderItem:
Dim SourceFile As FolderItem
SourceFile = GetFolderItem("C:\ExampleFolder\ExampleFile.txt", PathTypeAbsolute)
Dim destination As FolderItem
destination = GetFolderItem("C:\DestinationExample\", PathTypeAbsolute)
SourceFile.MoveFileTo(destination)
' or
SourceFile.CopyFileTo(destination)
Note that the CopyFileTo and MoveFileTo methods can't be used to move or copy directories, only files.