MoveFile

Moves a file to a new location.


Syntax

FileSystem.MoveFile(SourceFile, DestinationFile)

FileSystem.MoveFile(SourceFile, DestinationFile, Overwrite)


Parameters


SourceFile

String, input



Path of the file to be moved.


DestinationFile

String, input



Path of the directory into which the file should be moved.


Overwrite

Boolean, input



True if existing file should be overwritten; otherwise False. Default is False.


Examples

This example moves the specified file from one directory to another:


Sub Main()

FileSystem.MoveFile "C:\Users\Public\My Directory\Test.txt", "C:\Users\Public\Test Directory\Test.txt"

End Sub


This example move the specified file from one directory to another and renames the file:


Sub Main()

FileSystem.MoveFile "C:\Users\Public\My Directory\Test.txt", "C:\Users\Public\Test Directory\NewTest.txt"

End Sub