Results 1 to 3 of 3

Thread: Finding all EXEs on my computer

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    I want to be able to search for every file with an extection of .exe on my computer.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'Search a dir and subdirectories for a specific file pattern
    
    Private Sub GetFiles(sPath As String)
    
        Dim fso As Object
        Set fso = CreateObject("Scripting.FileSystemObject")
        Dim sFilename As String
        Dim fld
      
        If fso.FolderExists(sPath) Then
            sPath = sPath & IIf(Right$(sPath, 1) <> "\", "\", "")
            sFilename = Dir(sPath & "*.exe")
            Do While Len(sFilename)
                List1.AddItem sPath & sFilename
                sFilename = Dir
            Loop
            For Each fld In fso.GetFolder(sPath).SubFolders
                GetFiles fld.Path
            Next
        End If
    End Sub
    
    Private Sub Command1_Click()
        Call GetFiles("C:\")
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Guest
    This example from John Percival may help you as well:

    http://www.vb-world.net/demos/findfiles/

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