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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
| Dim Centre
Dim ListeCentre
Dim Plaque
Dim REP_SOURCE
Dim REP_DESTINATION
DIM LOG
Dim objFSO, objFolder, FileLog,fso,fileflag
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objArgs = Wscript.Arguments
VERSION="1.00"
centre = objArgs(0)
Select Case Centre
Case "AB"
Plaque="OR"
Case "CD"
Plaque="OR"
Case "EF"
Plaque="ARGENT"
Case "GH"
Plaque="ARGENT"
Case "IJ"
Plaque="ARGENT"
Case Else
Wscript.echo "Erreur dans le parametre"
wscript.quit(2)
End Select
LOG="E:\Appli\projets\Log\sauv_mens_" & centre & ".log"
Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
Set FileLog = FSO.CreateTextFile(Log)
MyDate = Day(Now) & "." & Month(Now) & "." & Year(Now)
'Debut du traitement
'For Each Centre In Split(ListeCentre,";",-1)
For Each Centre In Split(Centre,";",-1)
Source = "E:\Appli\projets_" & plaque & "\ " & Centre & "\TEST"
Destination = "H:\Historique\" & Centre & "\TEST\test_sauv_" & Centre & " " & MyDate & ".zip"
MyHex = _
Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
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
next
Function DelLogFiles(chemin)
Set ws = CreateObject("wscript.Shell")
command = "cmd /c Del "& chemin & "\*.log"
Resultat = Ws.Run(command,0,True)
End Function
Call DelLogFiles("E:\Appli\projets_" & plaque & "\ " & Centre & "\TEST") |
Partager