• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

Search for a File Or Folder On Any Local Drive

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
GMorgan
Asked:
GMorgan
  • 2
  • 2
1 Solution
 
xSinbadCommented:
0
 
xSinbadCommented:
Here is another one;
http://www.mvps.org/btmtz/drvscan/
0
 
rspahitzCommented:
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
 
rspahitzCommented:
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
 
GMorganAuthor Commented:
Thanks for the example it runs super fast!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now