MoveDirectory2

Moves a directory from one location to another.


Syntax

FileSystem.MoveDirectory2(SourceDirectory, DestinationDirectory, UIOption)

FileSystem.MoveDirectory2(SourceDirectory, DestinationDirectory, UIOption, UICancelOption)


Parameters


SourceDirectory

String, input



Path of the directory to be moved.


DestinationDirectory

String, input



Path of the directory to which the source directory is being moved.


UIOption

Enumeration, input



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



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 Directory1 inside Directory2, but does not show the progress of the operation:


Sub Main()

FileSystem.MoveDirectory2 "C:\Users\Public\Directory1", "C:\Users\Public\Directory2", UIOption.OnlyErrorDialogs, UICancelOption.ThrowException

End Sub