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 35 36 37 38 39 40 41 42 43 44 45 46 47
| ' Recherche répertoire(s)
'-------------------------------------------------------------------------------------------------------------
'Option Explicit
'On Error Resume Next
Set objWord = CreateObject("Word.Application")
Set objFso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
StrRep = "X:\Gssi"
'-------------------------------------------------------------------------------------------------------------
objFso.CreateTextFile("c:\Temp\Répertoires.log"),True
Set ObjFile = objFso.OpenTextFile("c:\Temp\Répertoires.log",8)
Sub listingSousDossiersRecur(objListRep, chemin)
Set Dossier = objFso.GetFolder(chemin)
Set cDossier = Dossier.SubFolders
For Each Dossier in cDossier
If Dossier.name="Procédures" Or Dossier.name="PROCEDURES" Then
' Wscript.echo Dossier.path
ObjFile.WriteLine Dossier.path
End If
Next
For Each oSousRep In objListRep
Set objListSousRep = oSousRep.SubFolders
Call listingSousDossiersRecur(objListSousRep, chemin & "\" & oSousRep.Name)
Next
End Sub
'----- Répertoire --------------------------------------------------------------------------------------------
If objFso.FolderExists(StrRep) Then
Set oRepCourant = objFso.GetFolder(StrRep)
End If
Set oSousRep = oRepCourant.SubFolders
Call listingSousDossiersRecur(oSousRep, oRepCourant.Path)
ObjFile.close |
Partager