Solved

Search for a File Or Folder On Any Local Drive

Posted on 2002-05-27
5
149 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 44
VBA filters 2 67
Excel Automation VBA 19 91
VB6 - Scroll Mouse wheel on Picturebox 13 79
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

820 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