I am looping through the drives and only want to process those that are
harddrives and not CD, floppy, dvd etc. What method(if any) or code do I
use?
What I am trying accomplish is to search for a certain type (i.e. *.bat,
*.ico etc) on every harddrive and return the name and path
(also a small graphic if its a graphic type object - ico, bmp etc)
Here is my code so far... Trying to figure out what to put in place of the
XXXXXXXXXX
If you have a better suggestion please feel free to let me know.
Dim strDrives As String()
Dim strThisDrive As String
Dim strThisDir As String
Dim strThisFile As String
Dim myFile As New StreamWriter("lsBMPImages.txt")
'get list of drives
strDrives = GetLogicalDrives()
'loop through each drive
For Each strThisDrive In strDrives
'loop through each directory
For Each strThisDir In GetDirectories(strThisDrive)
'get list of files - ONLY drive folders (no CD, floppy etc drives)
'XXXXXXXXXXXX
For Each strThisFile In GetFiles(strThisDir)
'look for the image we want
If strThisFile.EndsWith(strImage) Then
myFile.WriteLine(strThisFile & vbTab)
End If
Next
Next
Next
myFile.Close()