|
-
Aug 5th, 2002, 03:48 AM
#1
Thread Starter
Lively Member
copy directory
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)???
-
Aug 5th, 2002, 04:18 AM
#2
Hyperactive Member
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
-
Aug 5th, 2002, 04:57 AM
#3
-= B u g S l a y e r =-
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
-
Aug 5th, 2002, 04:59 AM
#4
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|