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

File Search Speed Issue

Status
Not open for further replies.

Mute101

Programmer
Jun 28, 2001
428
GB
Hi,

I need to search a directory for 2 different file types (extensions) and do stuff according to the files found.

I figured using the Application.FileSearch would be the best bet but I could be doing this search (across a network) up to four hundred times in one procedure call.

Code:
With Application.FileSearch
    .LookIn = "\\Raid_Pc\I\EDS\test\"
    .FileName = "*.IMG"
    If .Execute > 0 Then
        ' Option 1
    Else
        .NewSearch
        .LookIn = "\\Raid_Pc\I\EDS\test\"
        .FileName = "*.ISO"
        If .Execute > 0 Then
            ' Option 2
        Else
            ' Option 3
        End If
    End If
End With

----------------------------------------
My doctor says that I have a malformed public duty gland and a natural deficiency in moral fibre and that I'm therefore excused from saving universes.
----------------------------------------
 
Erf, sorry caught the submit button, looking at the code above is there a better solution to doing this speed wise?

----------------------------------------
My doctor says that I have a malformed public duty gland and a natural deficiency in moral fibre and that I'm therefore excused from saving universes.
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top