how can I let for copying the whole content of a directory in another directory (and to create the new directory if it doesn't already exist)???
Printable View
how can I let for copying the whole content of a directory in another directory (and to create the new directory if it doesn't already exist)???
I think copy method ,
I haven't use that but in MSDN it is specified, It copies a specified file or folder from one location to another.
Syntax:
object.Copy destination[, overwrite]
object required is always the name of a File or Folder object. Overwrite is true/false
Regards
Gary
the object Gary talks about is the File System Object.
Add a reference to the 'Microsoft Scripting Runtime' (scrrun.dll)
then try this little sample
:)VB Code:
Private Sub Command3_Click() Dim fso As New FileSystemObject fso.CopyFolder "C:\Test", "C:\Test2" End Sub
Another option is the File System Object.
Check MSDN for it.
Reference needed is Windows Scripting Runtime
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFoder "path to folder", "destintation path", OverWirte (true/False)
Use the FolderExists to check it's there first, CreateFolder if it isn't.
DanAzz