|
-
September 29th, 2005, 09:52 AM
#1
Copying files with FileSystemObject
Hi,
Can anyone tell me how I can do the following:
I need to copy a file from one location on my hard drive to another. I want to be able to overwrite existing files and be able to trap any errors that occur.
The code I use is as follows:
Code:
Dim fso as New FileSystemObject
Dim sSource as String
Dim sTarget as String
fso.CopyFile sSource, sTarget
By default this will overwrite existing files, but how can I check if there are errors?
Also, what are the other alternatives to using FileSystemObject to copy files, and which is the *best* way to do it?
Thanks very much,
dhartigan
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
|