Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > how to search a file?


Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2002, 07:57 AM
lazy_cat
Guest
 
Posts: n/a
Unhappy how to search a file?


Hello!

My English is not very well, I hope you can understand what I mean!

I want to write a program, that should find the games from Microsoft (like: freecell(freecell.exe), solitaire(sol.exe)...) and give me the path, where it is.

I tried to do it with fixed path, but now I want a programm, that search in all drives and directories.

I searched in old threads, but there were nothing, that really helped me.

thanks a lot
lazy_cat
Reply With Quote
  #2  
Old 10-21-2002, 08:00 AM
Termor's Avatar
Termor Termor is offline
Contributor

* Expert *
 
Join Date: Oct 2002
Location: Illinois, USA
Posts: 569
Default

Look up the Dir function is VB, you will want to put that in a function that gets called recursively until the search exe is found.
Reply With Quote
  #3  
Old 10-21-2002, 08:15 AM
lazy_cat
Guest
 
Posts: n/a
Default

thanks for the fast reply.
But it doesn't work. DIR function only search files in the directory where the program is.

helpme oncemore!!!
thanks
   lazy_cat
Reply With Quote
  #4  
Old 10-21-2002, 08:24 AM
Deadalus Deadalus is offline
Promising Talent

Retired Moderator
* Guru *
 
Join Date: May 2002
Location: Brussels
Posts: 3,601
Default

Quote:
DIR function only search files in the directory where the program is.
Not if you specify the directory. The hard part here is to make the procedure recursive, so that it keeps searching underlying folders untill there are none left. There is a clear explanation of this in the tutors corner by BillSoo.
Reply With Quote
  #5  
Old 10-21-2002, 08:30 AM
lazy_cat
Guest
 
Posts: n/a
Default

thanks a lot!!!!

    lazy_cat
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->