|
|
Title | Use a FileSystemObject to copy a folder hierarchy |
Description | This example shows how to use a FileSystemObject to copy a folder hierarchy in Visual Basic 6. It uses the object's CopyFolder method. |
Keywords | FileSystemObject, File System Object, FSO, CopyFolder, copy folder, folder, hierarchy, copy directory |
Categories | Files and Directories |
|
|
The program contains a reference to the Microsoft Scripting Runtime.
It creates an instance of the FileSystemObject and uses its CopyFolder method to copy a directory to a new location.
|
|
Private Sub cmdGo_Click()
Dim fso As FileSystemObject
Dim target_folder As Folder
' Copy the folder.
Set fso = New FileSystemObject
fso.CopyFolder txtCopyFrom.Text, _
txtCopyTo.Text, _
(chkOverwriteFiles.Value = vbChecked)
MsgBox "Ok"
End Sub
|
|
|
|
|
|