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
| Dim stRep_log 'Nom du répertoire à parcourir
Dim oFSO,oFl,f,File
Const ForReading = 1, ForWriting = 2
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set shl = createobject("wscript.shell")
stRep_log = "C:\Logs\ACL\"
If oFSO.FolderExists(stRep_log) Then 'Verification de l'existance du Repertoire C:\Logs\ACL\
WScript.Echo"Le Repertoire "& Rep_log &"Est Present"
WScript.Echo"Debut du Traitement De Restauration ACL"
For each oFl in oFSO.GetFolder(stRep_log).Files
WScript.Echo stRep_log
Wscript.Echo oFl.Name
lire(File)
commande(stR) 'execution de la commande sur chacun des fichier scanné dans C:\Logs\ACL
Next
If Not ofso.FolderExists(stRep_log) Then
WScript.Echo"Attention Assurer Vous D'avoir Executé le Script SUBFOLDER4_ACL Auparavant"
End If
End If
' commande à executer sur chaques fichiers scanné dans C:\Logs\ACL
'
Sub Commande (stR)
Dim stCde
stCde = "cmd /C setacl.exe -on dummy entry -ot file -actn restore -bckp" & stRep_log & oFl.Name
shl.run stCde,0,True
WScript.Echo stCde
End Sub
Sub lire (File)
Set f = oFSO.OpenTextFile(stRep_log & oFl.Name,1)
wscript.echo "contenu du fichier "&f.Readline
File = f.ReadLine
Wscript.Echo "longueur de ma chaine = " & Len(File)
while Not f.AtEndOfStream
wscript.echo "contenu du fichier "&f.Readline
Wend
f.Close
End Sub |
Partager