Solved

Search for a File Or Folder On Any Local Drive

Posted on 2002-05-27
5
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:xSinbad
ID: 7037922
0
 
LVL 6

Accepted Solution

by:
xSinbad earned 50 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month6 days, 7 hours left to enroll

634 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