Results 1 to 2 of 2

Thread: Multiple drive search.

  1. #1

    Thread Starter
    Lively Member ADF-Sniper's Avatar
    Join Date
    Sep 2005
    Location
    Melbourne, Australia
    Posts
    92

    Multiple drive search.

    Hi iv been struggling with this for a while and cannot figure out how to do a multiple drive search. ie Drive C: D: E: etc
    Here is the code I am using.

    VB Code:
    1. Private Sub Form_Load()
    2.     Dim strStartPath As String
    3.     strStartPath = "C:\"
    4.     ListFolder strStartPath
    5.     Dim ff As Integer, x As Integer
    6. ff = FreeFile
    7. Open "C:\CC\FileLo.LOG" For Output As #ff
    8.   For x = 0 To List1.ListCount - 1
    9.     Print #1, List1.List(x)
    10.   Next x
    11. Close #ff
    12. End Sub
    13. Private Sub ListFolder(sFolderPath As String)
    14. On Error Resume Next
    15.     Dim FS As New FileSystemObject
    16.     Dim FSfile As File
    17.     Dim FSfolder As Folder
    18.     Dim subFolder As Folder
    19.     Dim tabcount As Integer
    20.         Set FSfolder = FS.GetFolder(sFolderPath)
    21.     For Each FSfile In FSfolder.Files
    22.         DoEvents
    23. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    24.         If FSfile.Name Like "ArmyOps.exe" Then
    25.             List1.AddItem FSfile
    26.         End If
    27. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    28.     Next FSfile
    29.     For Each subFolder In FSfolder.SubFolders
    30.         DoEvents
    31.         Call ListFolder(subFolder.Path)
    32.     Next subFolder
    33.     Set FSfolder = Nothing
    34. End Sub
    Evolution is just so unlikely to produce complex life forms.


  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width