?
Solved

Search for a File Or Folder On Any Local Drive

Posted on 2002-05-27
5
Medium Priority
?
166 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

718 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