Solved

the fastest way to retrieve all directories on a drive?

Posted on 1997-08-22
3
174 Views
Last Modified: 2012-06-21
Whould you tell me the FASTEST way to retrieve all directories on a drive.Is there any API function or something else that can help me? I use recursively call of Dir$ function but it takes 20s for ~13000 files and ~900 folders. Please help! (I've VB5.0 Enterprise Edition)
0
Comment
Question by:polygon
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
wolfcrag earned 30 total points
ID: 1431903
The solution is to use FindFirstFile and FindNextFile API functions. They can also be used to find directories, not only files. It's a little bit long to describe here, but a beautiful example is on the following web page:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=341

If for some reason this URL doesn;t work, go to:

http://www.planet-source-code.com/vb/default.htm

and search for directory. The article is entitled: "Drive, Folder & File Property Page Demo"
0
 
LVL 2

Expert Comment

by:msiman
ID: 1431904
0
 
LVL 2

Expert Comment

by:msiman
ID: 1431905
Dear wolfrag,
Your answer is excellent.Thanks.
If you know something else that can help me you may email me at:
billy@sliven.osf.acad.bg
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question