Search Tools Links Login

Search Drive


Visual Basic 6, or VB Classic

Search Drive for files with a few lines o'code, Recursivly- Please VOTE!!!!

Original Author: Joseph Ronie

Assumptions

Add: Commandbutton, dir list box, file list box, text1.text, label1, label3, listbox

Code

Private Sub Command1_Click()
File1.Pattern = "*.exe"
Label3.Caption = "Searching " & File1.Pattern
Call search("C:")
End Sub
Public Sub search(dr As String)
Dim lst(5000) As String
Dim lstcnt As Integer
Dir1.Path = dr
listcnt = 0
Do While (Dir1.ListIndex < Dir1.ListCount - 1)
  Dir1.ListIndex = Dir1.ListIndex + 1
  listcnt = listcnt + 1
  lst(listcnt) = Dir1.List(Dir1.ListIndex)
Loop
For i = 1 To listcnt
  search (lst(i))
Next i
  
  File1.Path = Dir1.List(Dir1.ListIndex)
  DoEvents
  
  Do While (File1.ListIndex < _   File1.ListCount - 1)
   File1.ListIndex = File1.ListIndex + 1
   List1.AddItem (Dir1.List _(Dir1.ListIndex) & "" & File1.FileName)
   DoEvents
  Loop
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 86 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.