CopyDirectory

Copies the contents of a directory to another directory.


Syntax

FileSystem.CopyDirectory(SourceDirectory, DestinationDirectory)

FileSystem.CopyDirectory(SourceDirectory, DestinationDirectory, Overwrite)

FileSystem.CopyDirectory(SourceDirectory, DestinationDirectory, UIOption)

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


Parameters


SourceDirectory

String, input



First path to be combined.


DestinationDirectory

String, input



Second path to be combined.


Overwrite

Boolean, input



True to overwrite existing files, otherwise False. Default is False.


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.


Examples

Sub Main()

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

End Sub



Sub Main()

FileSystem.CopyDirectory "C:\Users\Public\My Directory\", "C:\Users\Public\Test Directory\", UIOption.AllDialogs, UICancelOption.ThrowException

End Sub