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
| ' ----- ExeScript Options Begin -----
' ScriptType: window
' DestDirectory: temp
' Icon: default
' OutputFile: "C:\Documents and Settings\%username%\Mes documents\sauvegarde_messagerie.txt"
' ----- ExeScript Options End -----
'Zone de notification
Set objExplorer = Wscript.CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 0
objExplorer.Height = 0
objExplorer.Left = 0
objExplorer.Top = 0
'temporisation de la zone de notification
Do While (objExplorer.Busy)
Wscript.Sleep 200
Loop
'Affiche la zone de notification
objExplorer.Visible = 1
objExplorer.Document.WriteLn "<title>Notification d'avancement du script</title>"
objExplorer.Document.WriteLn "<BODY bgcolor=#000066><align=""center""><br>"
'message de notification
Msg = "Test Robocopy..."
objExplorer.Document.WriteLn "<div><FONT size=2 FACE=""Arial"" color=white>" & Msg & "</div>"
'Test robocopy & copie de l'exe si besoin est
Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists("C:\WINDOWS\robocopy.exe") Then
objFSO.CopyFile "\\monserveur\netlogon\messagerie\robocopy.exe" , "C:\WINDOWS\robocopy.exe"
End If
'objFSO.CopyFile "\\monserveur\netlogon\messagerie\robocopy.exe" , "C:\WINDOWS\robocopy.exe"
'message de notification
Msg = "Demande..."
objExplorer.Document.WriteLn "<div><FONT size=2 FACE=""Arial"" color=white>" & Msg & "</div>"
'Création des objets
Set Shell1 = Wscript.CreateObject("Wscript.Shell")
ShellCopy1 = "robocopy c:\DOCUME~1\%username%\APPLIC~1\Thunderbird \\autreserveur\%username% /E /PURGE"
'MsgBox
rep = msgbox("Voulez-vous sauvegarder votre messagerie ? - Thunderbird doit être fermé (peut prendre plusieurs minutes selon la taille de votre messagerie)", 36, "Sauvegarder ?")
If rep = 6 Then
'message de notification
Msg = "Copie de C:..."
objExplorer.Document.WriteLn "<div><FONT size=2 FACE=""Arial"" color=white>" & Msg & "</div>"
Shell1.run ShellCopy1
Else
objExplorer.quit
Wscript.quit
End If
objExplorer.quit |
Partager