DIAdem Help

Method: CopyFolder for FileSystemObject

  • Updated2024-09-12
  • 2 minute(s) read

Method: CopyFolder for FileSystemObject

Copies a folder into another folder.

Object.CopyFolder(Source, Destination, [OverWriteFiles])
ObjectFileSystemObject
Object with this method
SourceString
Specifies the path of the folder that you want to copy. The path may contain wildcards in the last path component. If the source contains wildcards, the target path must lead to an existing folder.
DestinationString
Specifies the path of the target folder to which DIAdem copies the source folder. The path of the target folder must not contain wildcards. If the target is an existing file, an error occurs.
[OverWriteFiles]Boolean
Specifies whether DIAdem overwrites existing files. If the value is True, DIAdem overwrites existing files. If the value is False, DIAdem does not overwrite existing files. The default value is True.
Note  The CopyFolder method aborts as soon as the first error occurs. DIAdem does not undo changes made to the file system before an error occurred.

The following example copies the complete folder Example\Documents below the DIAdem program folder to the folder C:\Temp:

Sub CopyEntireFolder(sSource,sTarget,bOverwrite)
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  Call fso.CopyFolder(sSource,sTarget,bOverwrite)
End Sub
Call CopyEntireFolder(ProgramDrv & "Examples\Docume*", "c:\Temp",True)

See Also

Objects Overview

Log in to get a better experience