-
I want to copy a directory... we'll call it c:\tbw and all it's files and subdirectories and their files to C:\Program Files\TBW
What is the easiest way to do this?
-
<?>
I'll call mine A and you change the names to yours
Code:
'copy the contents of a floppy to a folder on a different drive
'copies files and folders seperately as they use different vehicles
'
Public Sub CopyA()
Dim FSO As Object
On Error GoTo NOFSO
Set FSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
FSO.CopyFile "A:\*", "C:\My Documents\", True
FSO.CopyFolder "A:\*", "C:\My Documents\", True
Set FSO = Nothing
Exit Sub
NOFSO:
MsgBox "FSO CreateObject Failed"
End Sub
-
Nope... this gives an error during the copying of the folders.
-
Are any of your files open in the copied directory? I just tried HeSaidJoe's code and it worked fine.
-
Take Caution
Take care when moving folders about using the FSO. It is very powerful. I 'accidently' screwed my PC over and had to reformat after moving all folders in C:\ into a new folder in C:\... it's a long story. Anyway, be careful dude :) :) :)
Laterz
REM