R
Randy Smith
Try this code to create a bug where the number of names
being returned should only be ONE, but instead, 3 are
returned. Apparently, any name being passed with the
FileName property is treated as though it has a built-in
wildcard.
In Windows 2000, there are 3 files that begin with
catsrv.dll (in Winnt/system32). But, if we try to only
retrieve the first one, all 3 will come back with
FoundFiles.Count.
Dim fs As Object
Set fs = Application.FileSearch
fs.NewSearch
fs.lookin = "C:\winnt\system32"
fs.MatchTextExactly = True
fs.FileName = "catsrv.dll"
If fs.Execute > 0 Then
MsgBox fs.FoundFiles.Count
Else
MsgBox "No files were found"
End If
Even though "catsrv.dll" was passed, in reality 3 files
were retrieved via the Execute method
("catsrv.dll", "catsrvps.dll", and "catsrvut.dll").
DOES anyone know of a workaround?
being returned should only be ONE, but instead, 3 are
returned. Apparently, any name being passed with the
FileName property is treated as though it has a built-in
wildcard.
In Windows 2000, there are 3 files that begin with
catsrv.dll (in Winnt/system32). But, if we try to only
retrieve the first one, all 3 will come back with
FoundFiles.Count.
Dim fs As Object
Set fs = Application.FileSearch
fs.NewSearch
fs.lookin = "C:\winnt\system32"
fs.MatchTextExactly = True
fs.FileName = "catsrv.dll"
If fs.Execute > 0 Then
MsgBox fs.FoundFiles.Count
Else
MsgBox "No files were found"
End If
Even though "catsrv.dll" was passed, in reality 3 files
were retrieved via the Execute method
("catsrv.dll", "catsrvps.dll", and "catsrvut.dll").
DOES anyone know of a workaround?