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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for a matching filename in a directory 1

Status
Not open for further replies.

fergmj

Programmer
Joined
Feb 21, 2001
Messages
276
Location
US
Here is the situation:

Dim cutname
cutname = 01040301.023 ' the cutname is the exact format of a file
I want to search a directory and find a file that matches cutname
When I find that file, I want to copy the file (audio) to a new directory

Any help?

Thanks.

Mindy
 
SearchDir = "C:\My Documents\...(etc.)...\"
DestDir = "C:...(etc.)"
CutName = "01040301.023"
If Dir(SearchDir & CutName) <> &quot;&quot; Then
FileCopy SearchDir & CutName, DestDir & CutName
End If Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top