MoveDirectory

Moves a directory from one location to another.


Syntax

FileSystem.MoveDirectory(SourceDirectory, DestinationDirectory)

FileSystem.MoveDirectory(SourceDirectory, DestinationDirectory, Overwrite)

FileSystem.MoveDirectory(SourceDirectory, DestinationDirectory, UIOption)

FileSystem.MoveDirectory(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.


Overwrite

Boolean, 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.


Examples


This example moves Directory1 inside Directory2:


Sub Main()

FileSystem.MoveDirectory "C:\Users\Public\Directory1", "C:\Users\Public\Directory2"

End Sub