Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This programme contains a recursive procedure whic...
Author:
Abhilash Panickar
E-mail:
Click to e-mail author
Submitted:
11/3/2000
Version:
VB5
Compatibility:
VB5, VB6
Category:
File Manipulation
Views:
10013
This programme contains a recursive procedure which calls itself while scanning the host computers file system for files.An intresting bit of code , considering that you can search for specific files like WAV files , store it in an array and play them nonstop, or you could search for all picture files on the disk and dislay them, or delete files and stuff like that.
Declarations:
'add a ref to Microsoft scripting runtime Dim fsys As New FileSystemObject
Code:
Public Function scan(fname As String)' (supply path like c:\) Dim ffolder As Folder Dim sfolder As Folders Dim fitem As Folder Dim fileitem As File Dim allfiles As Files DoEvents Me.Caption = fname Set ffolder = fsys.GetFolder(fname) Set sfolder = ffolder.SubFolders Set allfiles = ffolder.Files For Each fitem In sfolder scan (fitem.Path) Next For Each fileitem In allfiles If fileitem.Type = "Microsoft Word Document" Then (you can search for specific files by setting the type method. here i am searching for word files) List1.AddItem " ** File ** " & fileitem.Path & fileitem.Type End If Next End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2023 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement