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
| Dim Fich,fso, Ret
Ret = ""
Set fso = CreateObject("Scripting.FileSystemObject")
Set Fich = fso.OpenTextFile("C:\temp\decompress.log",2,True)
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
ExecQuery("c")
ExecQuery("d")
ExecQuery("e")
Sub ExecQuery(sDrive)
wql="SELECT * FROM Win32_Directory WHERE (Drive='" & sDrive & ":') AND NOT Name like 'C:\\WINDOWS\\$Nt%' AND NOT Name='C:\\WINDOWS\\$hf_mig$' AND NOT Name='C:\\WINDOWS\\ie7' AND NOT Name='C:\\WINDOWS\\ie8'"
Set colFolders = objWMIService.ExecQuery( wql )
For Each objFolder in colFolders
errResults = objFolder.Uncompress()
'Wscript.Echo objFolder.Caption
Ret = Ret + objFolder.Caption + VbNewLine
Next
Fich.Write Ret
Fich.Close
Set fso = Nothing
Set Fich = Nothing
End Sub |
Partager