MoveFile2

Moves a file to a new location.


Syntax

FileSystem.MoveFile2(SourceFile, DestinationFile, UIOption)

FileSystem.MoveFile2(SourceFile, DestinationFile, UIOption, UICancelOption)


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.


UIOption

Enumeration, input



Whether to visually track the operation's progress. Default is OnlyErrorDialogs.


UICancelOption

Enumeration, input



Specifies what should be done if the user clicks Cancel during the operation. Default is ThrowException.


Remarks


UIOption



UIOption.AllDialogs

Show progress dialog box and any error dialog boxes.


UIOption.OnlyErrorDialogs

Only show error dialog boxes and hide progress dialog boxes. Default.


UICancelOption



UICancelOption.DoNothing

Do nothing when the user clicks Cancel.


UICancelOption.ThrowException

Throw an exception when the user clicks Cancel. Default.


Example

This example moves the specified file from one directory to another, but does not show the progress of the operation::


Sub Main()

FileSystem.MoveFile2 "C:\Users\Public\My Directory\Test.txt", "C:\Users\Public\Test Directory\Test.txt", UIOption.OnlyErrorDialogs, UICancelOption.ThrowException

End Sub