Results 1 to 2 of 2

Thread: list all files in a computer

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Posts
    48

    list all files in a computer

    Hi!
    i want to list all the exe files in my computer. Is there any way you can do that?

    i tried this code, but it only gives me the files in the directory.

    Dim d() As String
    Dim en As System.Collections.IEnumerator
    Dim strDrive As String
    Dim strFolder
    For Each strDrive In Directory.GetLogicalDrives
    Try
    For Each strFolder In Directory.GetDirectories(strDrive)
    d = System.IO.Directory.GetFiles(strFolder, "*.exe")
    en = d.GetEnumerator
    While en.MoveNext
    Console.WriteLine(CStr(en.Current))
    End While
    Next
    Catch
    End Try
    Next

    thanks.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Search this forum for recursive methods.

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