|
-
Jul 27th, 2000, 11:27 AM
#1
Thread Starter
Lively Member
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?
-
Jul 27th, 2000, 12:01 PM
#2
_______
<?>
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
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 27th, 2000, 12:42 PM
#3
Thread Starter
Lively Member
Nope... this gives an error during the copying of the folders.
-
Jul 27th, 2000, 12:55 PM
#4
Fanatic Member
Are any of your files open in the copied directory? I just tried HeSaidJoe's code and it worked fine.
Chemically Formulated As:
Dr. Nitro
-
Jul 27th, 2000, 12:56 PM
#5
Lively Member
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
"Innovate, don't immitate."
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
|