File Searching

J

James

We have a need to search through an entire drive for a specific file name.
The process is currently written with recursive loops through each directory
and the Scripting.FileSystemObject. Problem is, it takes forever. When I
do a standard file search through Windows Explorer, it typically finds the
file I'm looking for within 5 seconds. Is there another approach to file
searching, or am I stuck with trying to make this recursive loop somehow
more efficient?

Thanks!
James
 
R

Richard Gutery

Easiest thing that I did for this kind of problem for a client, was to
create a ActiveX component in VB6, then used this component on the client
web site.

Typical time to find a file was less than 10 seconds when the file was
located in a 20 level folder structure on a 100GB drive that was 85% full.

Hope it helps.
 
R

Roland Hall

in message : We have a need to search through an entire drive for a specific file name.

How unorganized is this drive?

: The process is currently written with recursive loops through each
directory
: and the Scripting.FileSystemObject. Problem is, it takes forever.

And if your file was the last one searched, wouldn't Search also take a long
time although subsequent searches I believe are cached. So, if you cached
your search in FSO, would you get the same results by first searching your
cache?

: When I
: do a standard file search through Windows Explorer, it typically finds the
: file I'm looking for within 5 seconds.

This particular file or just in general. Define typically.

: Is there another approach to file
: searching, or am I stuck with trying to make this recursive loop somehow
: more efficient?

Perhaps a COMponent that can use APIs might be faster. Without seeing your
code, who knows if your routine can become more efficient?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top