473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

File Searching

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
Jul 22 '05 #1
4 1631
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.

"James" <cp******@aol.com> wrote in message
news:eO****************@TK2MSFTNGP14.phx.gbl...
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

Jul 22 '05 #2
It finds the file in 5sec, but is it DONE searching in 5sec?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"James" <cp******@aol.com> wrote in message
news:eO****************@TK2MSFTNGP14.phx.gbl...
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

Jul 22 '05 #3
"James" wrote in message news:eO****************@TK2MSFTNGP14.phx.gbl...
: 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
Jul 22 '05 #4
You need to index your data. Have a process that spiders your
site/files and then search that index. MS Index Service is probably
easiest, as it's built into Windows.
http://www.kevinroth.com/projects/project.asp?id=371
Cheers,
Daniel
http://www.danhendricks.com

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: rakesh | last post by:
Hi, I have a requirement in which I need to search a string in a file stored on a harddisk. String which needs to be searched would be stored in a file with delimiter as new line character. some...
3
by: Paul H | last post by:
I have a text file that contains the following: ******************** __StartCustomerID_41 Name: Fred Smith Address: 57 Pew Road Croydon
19
by: Johnny Google | last post by:
Here is an example of the type of data from a file I will have: Apple,4322,3435,4653,6543,4652 Banana,6934,5423,6753,6531 Carrot,3454,4534,3434,1111,9120,5453 Cheese,4411,5522,6622,6641 The...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
7
by: pbd22 | last post by:
Hi. I am somewhat new to this and would like some advice. I want to search my xml file using "keyword" search and return results based on "proximity matching" - in other words, since the search...
5
by: bir | last post by:
I have a folder which contains the xml files with the word CICM in the filename (can also contain some other files) I need to search for all these xml files and create a single zip file for all...
4
by: Hunk | last post by:
Hi I have a binary file which contains records sorted by Identifiers which are strings. The Identifiers are stored in ascending order. I would have to write a routine to give the record given...
9
by: Hollywood | last post by:
Hello members of the comp.lang.c++, My log file is made of a set of 1000 following lines kind: 21/09/07 13:49:56,MW.SET.D_IGLS,2.000000 21/09/07 13:49:56,MW.SET.GNP_NT,7.000000 ..... ...
5
by: Sevla | last post by:
hello guys i set this code , and i would like to know if its possible set "quotes" on the searched word. Thank You #word searching program within a txt file #!C:/perl/bin/perl.exe start:
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.