Find files of certain type 
Author Message
 Find files of certain type

I need to find all files of a certain type (*.mp3) in a given path and all
sub directories and add them to a listbox. Should look like this:

C:\MP3s\Rock\ACDC - Thunderstruck.mp3
C:\MP3s\Theme Simpsons.mp3
...

How to do that without additional listboxes?

--
mfg,
Martin H?ller
http://www.*-*-*.com/



Mon, 25 Aug 2003 05:23:47 GMT  
 Find files of certain type
You should do this with the FileSystemObject

Reference "Scripting.FileSystemObject" (Microsoft Scripting Runtime)

Dim FS as new Scripting.FileSystemObject
Dim Folder as Scripting.Folder

Sub Main()

End Sub

Sub LoadMP3Files(Folder as Scripting.Folder)
    Dim SubFolder as Scripting.Folder
    Dim File as Scripting.File

    For each SubFolder in Folder.SubFolders
        LoadMP3Files(SubFolder)
    Next
    For each File in Folder.Files
        If ucase(right(File.Name,3))="MP3" then
            'Now do with the File what ever you want
            'For Example add it to a list
        End If
    Next
End Sub

And again all out of memory. I hope it works :o)


Quote:
> I need to find all files of a certain type (*.mp3) in a given path and all
> sub directories and add them to a listbox. Should look like this:

> C:\MP3s\Rock\ACDC - Thunderstruck.mp3
> C:\MP3s\Theme Simpsons.mp3
> ...

> How to do that without additional listboxes?

> --
> mfg,
> Martin H?ller
> http://members.aon.at/m.hoeller



Mon, 25 Aug 2003 06:19:08 GMT  
 Find files of certain type
http://www.mvps.org/vbnet/code/fileapi/recursive.htm


http://www.mvps.org/vbnet/code/fileapi/fsoapicompare.htm

--

Randy Birch
MVP Visual Basic

Take the vb.net poll at:
http://www.mvps.org/vbnet/
http://www.mvps.org/ccrp/

Please respond only to the newsgroups so all can benefit.


: I need to find all files of a certain type (*.mp3) in a given path and all
: sub directories and add them to a listbox. Should look like this:
:
: C:\MP3s\Rock\ACDC - Thunderstruck.mp3
: C:\MP3s\Theme Simpsons.mp3
: ...
:
: How to do that without additional listboxes?
:
: --
: mfg,
: Martin Hvller
: http://members.aon.at/m.hoeller
:
:



Mon, 25 Aug 2003 07:54:21 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. procedure to find certain files from a certain date on harddisk

2. Automatically add certain type of file as attachment

3. How to:search a certain type of file on disk

4. Where do I find certain file

5. Find files updated after certain date in a folder

6. Random access files - having and finding multiple types of record in one file

7. Dynamically Creating an object of a certain type

8. I am Looking for certain ico. type images

9. Select Field List for RowSource Type but only certain fields

10. How to find the files of a specific type in a folder

11. Where do I find common icon type files??

12. Where do I find common icon type files????

 

 
Powered by phpBB® Forum Software