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:
Private Sub Form_Load() Dim strStartPath As String strStartPath = "C:\" ListFolder strStartPath Dim ff As Integer, x As Integer ff = FreeFile Open "C:\CC\FileLo.LOG" For Output As #ff For x = 0 To List1.ListCount - 1 Print #1, List1.List(x) Next x Close #ff End Sub Private Sub ListFolder(sFolderPath As String) On Error Resume Next Dim FS As New FileSystemObject Dim FSfile As File Dim FSfolder As Folder Dim subFolder As Folder Dim tabcount As Integer Set FSfolder = FS.GetFolder(sFolderPath) For Each FSfile In FSfolder.Files DoEvents '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If FSfile.Name Like "ArmyOps.exe" Then List1.AddItem FSfile End If '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Next FSfile For Each subFolder In FSfolder.SubFolders DoEvents Call ListFolder(subFolder.Path) Next subFolder Set FSfolder = Nothing End Sub




Reply With Quote
