1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Set fso = CreateObject("Scripting.FileSystemObject")
Set Rept = fso.GetFolder(CheminParent)
Set SousRept = Rept.SubFolders
'Parcourir les sous-dossiers
For Each direct In SousRept
Set DirEnCours = fso.GetFolder(direct.Name)
Set fichiers = DirEnCours.Files
'Parcourir les fichiers
For Each fichier In fichiers
if righ(uCase(fichier.Name), 3) = "INI" then
fso.CopyFile LeFichier, direct.Name\LeFichier
Exit For
end if
Next
Exit For
Next
Set SousRept = Nothing
Set Rept = Nothing
Set fso = Nothing |
Partager