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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
<html>
<head>
<title>Backup utility</title>
</head>
<body>
Select backup option :
<br>
<input type="checkbox" ID="PST" name="PST"> : Backup all PST files present in your user profile.
<br>
<div id = "listingPST" name="listingPST"></div>
<div id = "ValidePST" name="ValidePST"></div>
<div id = "Encours" name="Encours"></div>
<br>
<input type="button" id="BTvalider" name="valider" value="Start" onclick="backup()">
<input type="button" Id="BTFermer" name="BTFermer" value="Close" OnClick="fermer()">
<br>
</body>
</html>
<script type="text/javascript">
function fermer()
{
self.close();
}
</script>
<SCRIPT LANGUAGE="VBScript">
ResizeTo 670,460
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = CreateObject("WScript.Network")
Set WshShell = CreateObject("WScript.Shell")
Sub VerifProcessPST(objProcess)
For Each Process In GetObject("winmgmts:").InstancesOf("Win32_process")
If UCase(Process.Name) = UCase(objProcess) Then
msgbox "Backup canceled : " & Process.Name & " is active..."& Chr(13) &"Close Outlook and launch again utility"
Exit Sub
End If
Next
ListPST folder, ext
End Sub
'======================================================================
' TEST list PST
'======================================================================
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
start_folder = WshShell.ExpandEnvironmentStrings("%USERPROFILE%")
ext = Array("pst")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set folder = oFSO.GetFolder(start_folder)
Sub ListPST(folder, ext)
Encours.innerhtml = " Select PST to save : "
For Each objFile In folder.Files
If (UCase(ext(0)) = UCase(oFSO.GetExtensionName(objFile.Name))) Then
strFileName = objFile.Name
strFilePath = objFile.ParentFolder
listingPST.innerHTML = listingPST.innerHTML & ("<input type='checkbox' value='" & count & "' name='" & count & "' onclick=''></input>") & " " & strFileName & "<BR>"
'listingPST.innerHTML = listingPST.innerHTML & strFileName & "<BR>"
msgbox count
End If
Next
For Each fldr In folder.subfolders
ListPST fldr, ext
Next
End Sub
' FIN TEST
'======================================================================
'==================================================================================================================
'Fonction après avoir appuyé sur le bouton continuer.
'Vérifie si un choix est coché et execute le backup de l'option sélectionné.
'==================================================================================================================
Sub backup
If objGroup.IsMember(objUser.ADsPath) Then
if (PST.Checked = false) then
Msgbox "Please select one option before continuing"
else
reponse = msgbox ("The backup can take few minutes, do you want continue ?", vbYesNo)
If reponse = vbYes then
If PST.Checked Then
VerifProcessPST("outlook.exe")
End if
BTvalider.disabled = False
BTFermer.disabled = False
else
msgbox " Backup finish"
fermer()
End If
End if
Else
Msgbox "Your are not allowed to use this utility."
End if
End Sub
</SCRIPT> |
Partager