1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Dim fso 'As FileSystemObject
Dim i 'As Integer
Dim ficListe
i = 0
Dim FolderInit 'As Scripting.Folder
Set fso = CreateObject("Scripting.FileSystemObject")
Set FolderInit = fso.GetFolder("D:\Donnees\") 'Repertoire à parcourir
Set ficListe = fso.CreateTextFile("d:\tmp\liste.txt")
traiteRepertoire FolderInit
ficListe.Close
'
' Fonction récursive...
'
Sub traiteRepertoire(SousFolder) 'As Folder)
Dim NewFolder 'As Scripting.Folder
Dim f 'As File
For Each f In SousFolder.Files
If (f.DateLastModified >= Date-1) And Right(f.Name, 3) = "pp2" Then
i = i + 1
wscript.echo i & ":" & f.Path
ficListe.WriteLine f.Name
End If
Next
For Each NewFolder In SousFolder.SubFolders
'wscript.echo NewFolder.Path
traiteRepertoire NewFolder
Next
End Sub |
Partager