Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy File - Mysterious Problem 1

Status
Not open for further replies.

DougAtAvalon

Programmer
Jan 29, 2001
99
0
0
US
============================
Dim strSource As String
Dim strDest As String

strSource = "D:\Development.mdb"
strDest = "D:\DougsWork\"

FileCopy strSource, strDest

End Sub
============================

i am getting a Path not found error with the above code and I see the above paths in the address bar . . . very odd

-Doug
 
Hi,

I think the source and destination strings must both contain file names (could be the same, of course). They can both optionally include paths but they must end with a filename

eg FileCopy "D:\Development.mdb","D:\DougsWork\Development.mdb"

 
Hi!

I'm having the same issue, but I'm trying to use wildcards to copy all the files within a dir to another dir. Any ideas?

Thanks,
Ken
 
I think you have to quote a filename when using FileCopy, so wildcards won't do it. How about using the FileSystemObject - that contains a 'CopyFolder' method which does what you are looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top