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

x
?
Solved

Search for a File Or Folder On Any Local Drive

Posted on 2002-05-27
5
Medium Priority
?
171 Views
Last Modified: 2010-05-02
I'm sure that I should know this or could figure it out if I had more time but I thought I would ask if anyone has code to seach for any file or folder on any local drive and then display it's path.
0
Comment
Question by:GMorgan
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:xSinbad
ID: 7037922
0
 
LVL 6

Accepted Solution

by:
xSinbad earned 200 total points
ID: 7037930
Here is another one;
http://www.mvps.org/btmtz/drvscan/
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7039825
This works in DOS and can be used in VB:

DOS:
Dir filename.extension /s /b

VB:
shell("Dir filename.extension /s /b> C:\tempfile.xxx")
open "C:\tempfile.xxx" for input as #1
line input #1, MyVar
close #1
Label1.Caption = MyVar
kill "C:\tempfile.xxx"
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7039831
Actually, you may need to prefix the Dir with a command processor:

shell(environ("ComSpec") & " /c Dir filename.extension /s /b> C:\tempfile.xxx")

0
 

Author Comment

by:GMorgan
ID: 7040609
Thanks for the example it runs super fast!
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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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

885 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