For i = 0 To UBound(MyHex)
MyBinary = MyBinary & Chr(MyHex(i))
Next
Set oShell = CreateObject("WScript.Shell")
Set oFileSys = CreateObject("Scripting.FileSystemObject")
'Creation du zip
Set oCTF = oFileSys.CreateTextFile(Destination, True)
oCTF.Write MyBinary
oCTF.Close
Set oCTF = Nothing
Set oApp = CreateObject("Shell.Application")
Set oFolder = oApp.NameSpace(Source)
If Not oFolder Is Nothing Then _
oApp.NameSpace(Destination).CopyHere oFolder.Items
wScript.Sleep 5000
Set oFile = Nothing
On Error Resume Next
Do While (oFile Is Nothing)
'Attention: provoque une erreur 70 si un des fichiers à zipper
'est toujours ouvert.
Set oFile = oFileSys.OpenTextFile(Destination, ForAppending, False)
If Err.Number <> 0 Then
Err.Clear
wScript.Sleep 3000
End If
Loop
ydu
Messages postés61Date d'inscriptionmercredi 1 mars 2006StatutMembreDernière intervention 6 août 2009 20 sept. 2007 à 23:49
Bonjour,
Je viens metter mon article à jour car j'ai trouver un code en VBA qui fonctionne très bien dans une macro mais je voudrai le faire en VBS quelqu'un peut il m'aider svp ?
ci dessous le code
@+
Sub ZipFichier()
Dim oShell As Object, Fso As Object
Dim i As Long
Dim Fichier As String, MyBinary As String
Dim LeZip As Variant
Dim MyHex As Variant