Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

the fastest way to retrieve all directories on a drive?

Posted on 1997-08-22
3
Medium Priority
?
183 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 120 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

886 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