Auto-commit: 2025-10-31 08:58:35
This commit is contained in:
2
USMT-Gui-Replace-Scenario/Start.bat
Normal file
2
USMT-Gui-Replace-Scenario/Start.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
net stop wuauserv
|
||||
Start "Lance" mshta "%~dp0USMTstartV4.3.hta"
|
||||
BIN
USMT-Gui-Replace-Scenario/Tools/Blat.zip
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/Blat.zip
Normal file
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
dim strUser, strPass
|
||||
strUser = "Proservia1"
|
||||
strPass = "Psv@2016"
|
||||
|
||||
|
||||
|
||||
Set Shell = WScript.CreateObject("WScript.Shell")
|
||||
CodeRetour = Shell.run("cmd /c net user " & strUser & " " & strPass & " /add",0,True)
|
||||
CodeRetour = Shell.run("cmd /c net localgroup " & chr(34) & "Administrateurs" & chr(34) & " " & strUser & " /add",0,True)
|
||||
|
||||
Set objUser = Getobject("WinNT://" & "." & "/" & strUser)
|
||||
'Password never expires flag
|
||||
Flags = objUser.Get("UserFlags")
|
||||
objUser.put "Userflags", flags OR &H10000
|
||||
objUser.setinfo
|
||||
365
USMT-Gui-Replace-Scenario/Tools/CustomBackup.vbs
Normal file
365
USMT-Gui-Replace-Scenario/Tools/CustomBackup.vbs
Normal file
@@ -0,0 +1,365 @@
|
||||
Const HKEY_LOCAL_MACHINE = &H80000002
|
||||
|
||||
Dim args, Fso,Shell
|
||||
Set args = Wscript.Arguments
|
||||
Set Fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set Shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Dim FolderBackup, strOs, strArchi, FUsers, PartW, PatchNotes, VersionNotes, LogFile, Temp, UserBackup, ExitCode
|
||||
Dim robocopy, Extention
|
||||
ExitCode = 0
|
||||
' --------------------- Chemin fichier INI ------------------------------------
|
||||
PatchHTA = WScript.ScriptFullName
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\") -1)
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\"))
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
StrComputerName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
if args.count = 0 Then
|
||||
Msgbox "Error Args"
|
||||
Else
|
||||
FolderBackup = args(0)
|
||||
if args.count = 2 Then
|
||||
UserBackup = args(1)
|
||||
Else
|
||||
UserBackup = ","
|
||||
End If
|
||||
End If
|
||||
|
||||
TempUser = Split(UserBackup,",")
|
||||
|
||||
' --------------------- Detection de l'OS -------------------------------------
|
||||
Set objRegistry=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\default:StdRegProv")
|
||||
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
|
||||
strValueName = "ProductName"
|
||||
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,ProductName
|
||||
strOs = UCase(ProductName)
|
||||
If instr(UCase(ProductName),"WINDOWS XP") <> 0 Then strOs = "Windows_XP"
|
||||
If instr(UCase(ProductName),"WINDOWS 7") <> 0 Then strOs = "Windows_7"
|
||||
If instr(UCase(ProductName),"WINDOWS 8") <> 0 Then strOs = "Windows_8"
|
||||
If instr(UCase(ProductName),"VISTA") <> 0 Then strOs = "windows_vista"
|
||||
If instr(UCase(ProductName),"Windows 10") <> 0 Then strOs = "Windows_10"
|
||||
|
||||
' --------------------- Detection de l'architecture ---------------------------
|
||||
strArchi = "x86"
|
||||
If Fso.FolderExists("c:\windows\SysWow64") Then strArchi = "x64"
|
||||
|
||||
|
||||
' --------------------- Detection de la version Lotus Notes ------------------
|
||||
PatchNotes = ""
|
||||
If Fso.FileExists("c:\Program Files\Lotus\Notes\Notes.exe") Then PatchNotes = "c:\Program Files\Lotus\Notes\Notes.exe"
|
||||
If Fso.FileExists("c:\Program Files\Notes\Notes.exe") Then PatchNotes = "c:\Program Files\Notes\Notes.exe"
|
||||
If Fso.FileExists("c:\Program Files (x86)\Lotus\Notes\Notes.exe") Then PatchNotes = "c:\Program Files (x86)\Lotus\Notes\Notes.exe"
|
||||
If Fso.FileExists("c:\Program Files (x86)\Notes\Notes.exe") Then PatchNotes = "c:\Program Files (x86)\Notes\Notes.exe"
|
||||
If PatchNotes <> "" Then
|
||||
VersionNotes = GetVersion(PatchNotes)
|
||||
Else
|
||||
VersionNotes = 0.0
|
||||
End If
|
||||
|
||||
|
||||
' #############################################################################
|
||||
LogFile = Left(FolderBackup,Len(FolderBackup) - (Len(FolderBackup) - InstrRev(FolderBackup,"\"))) & StrComputerName & "\CustomBackup.log"
|
||||
If Fso.FileExists(LogFile) Then CodeRetour = Fso.deleteFile(LogFile,True)
|
||||
TraceLog LogFile , "#############################################################################"
|
||||
TraceLog LogFile , "#############################################################################"
|
||||
TraceLog LogFile , "FolderBackup=" & FolderBackup
|
||||
TraceLog LogFile , "strOs=" & strOs
|
||||
TraceLog LogFile , "strArchi=" & strArchi
|
||||
TraceLog LogFile , "PatchNotes=" & PatchNotes
|
||||
TraceLog LogFile , "VersionNotes=" & VersionNotes
|
||||
If PatchNotes = "" Then TraceLog LogFile , "Lotus Notes Not Found"
|
||||
|
||||
' Utilisation du robocopy <> si XP sinon on utilise celui natif dans Windows
|
||||
robocopy = "c:\windows\system32\robocopy.exe"
|
||||
if Fso.fileExists("c:\windows\system32\robocopy.exe") then
|
||||
robocopy = "c:\windows\system32\robocopy.exe"
|
||||
Else
|
||||
robocopy = Getpath & "robocopy.exe"
|
||||
End If
|
||||
TraceLog LogFile , "Chemin robocopy :" & robocopy
|
||||
|
||||
' ----------------------- premiere pass pour les dossier non users -----------
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "----------------------- premiere pass pour les dossier non users -----------"
|
||||
LectureTransfert = 0
|
||||
set inf= Fso.OpenTextFile(PatchHTA & "USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
If Left(Ligne,1) <> ";" And Ligne <> "" And Left(Ligne,1) <> "[" Then
|
||||
If LectureTransfert = 1 Then
|
||||
Ligne = UCase(Ligne)
|
||||
|
||||
If Instr(Ligne,"C:\USERS\%USERNAME%") = 0 Then
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "Ligne:" & Ligne
|
||||
|
||||
If instr(Ligne,"==") <> 0 Then
|
||||
Templigne = split(Ligne,"==")
|
||||
Ligne = Templigne(0) ' pas de prise en compte de la conversion lors de la sauvegarde
|
||||
TraceLog LogFile , "Ligne==" & Ligne
|
||||
End If
|
||||
|
||||
|
||||
' verification si extension selectionnée
|
||||
Extention = " "
|
||||
If Instr(Ligne,"\*.") Then
|
||||
Temppath = Split(Ligne,"\*.")
|
||||
Ligne = Temppath(0) 'je garde uniquement le chemin
|
||||
Extention = " *." & Temppath(1) & " "
|
||||
Else
|
||||
Extention = " "
|
||||
End If
|
||||
|
||||
' Definition du dossier source
|
||||
Source = ligne
|
||||
TraceLog LogFile , "Source:" & Source
|
||||
|
||||
' test sur c:\program files et c:\program files (x86)
|
||||
If Instr(Ligne,"C:\PROGRAM FILES\") <> 0 Then
|
||||
If Fso.folderExists(Ligne) = False Then
|
||||
TempLigne = Replace(Ligne, "C:\PROGRAM FILES\", "C:\PROGRAM FILES (X86)\")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source (PROGRAM FILES\)=>" & Source
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
End If
|
||||
|
||||
' Definition du dossier de destination
|
||||
TraceLog LogFile , "Destination:" & FolderBackup & "\" & Ligne
|
||||
Destination = FolderBackup & "\" & Replace(UCase(Ligne), "C:","C")
|
||||
Destination = Replace(UCase(Destination), "D:","D")
|
||||
TraceLog LogFile , "Destination Final:" & Destination
|
||||
|
||||
If Fso.FolderExists(Source) Then
|
||||
TraceLog LogFile , "Found! " & Source
|
||||
Commande = chr(34) & robocopy & chr(34) & " " & Chr(34) & Source & chr(34) & " " & chr(34) & Destination & chr(34) & Extention & "/MIR /R:3" & " /log+:" & chr(34) & LogFile & chr(34)
|
||||
TraceLog LogFile , Commande
|
||||
CodeRetour = Shell.run(Commande,,True)
|
||||
TraceLog LogFile , "EXIT : " & CodeRetour
|
||||
TraceLog LogFile , " "
|
||||
If CodeRetour = 1 then CodeRetour = 0
|
||||
If CodeRetour = 2 then CodeRetour = 0
|
||||
ExitCode = ExitCode + CodeRetour
|
||||
Else
|
||||
TraceLog LogFile , "not Exist " & Source
|
||||
TraceLog LogFile , " "
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
if Instr(UCase(Ligne),"[") <> 0 And Instr(UCase(Ligne),"]") <> 0 Then LectureTransfert = 0
|
||||
If Instr(UCase(Ligne),"[TRANSFERT]") <> 0 Then LectureTransfert = 1
|
||||
Wend
|
||||
inf.close
|
||||
|
||||
' --------------------- Boucle Users ------------------------------------------
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "--------------------- Boucle Users ------------------------------------------"
|
||||
' Enumeration des users Partition C
|
||||
FUsers = ""
|
||||
If Fso.FolderExists("c:\Documents And Settings") Then FUsers = "c:\Documents And Settings"
|
||||
If Fso.FolderExists("c:\Users") Then FUsers = "c:\Users"
|
||||
TraceLog LogFile , "FUsers=" & FUsers
|
||||
If FUsers <> "" Then
|
||||
Set fs=Fso.GetFolder(FUsers)
|
||||
Set collfolders = fs.SubFolders
|
||||
For each folder in collfolders
|
||||
curfolder = FUsers & "\" & folder.name
|
||||
OKuser = 0
|
||||
For i = 0 to Ubound(TempUser)
|
||||
If UCase(folder.name) = UCase(TempUser(i)) Then OKuser = 1
|
||||
Next
|
||||
|
||||
If OKuser = 1 Then
|
||||
TraceLog LogFile , "Backup User=" & folder.name
|
||||
TraceLog LogFile , " "
|
||||
call CopyUsers(curfolder)
|
||||
Else
|
||||
TraceLog LogFile , "Exclude User=" & folder.name
|
||||
TraceLog LogFile , " "
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
' Enumeration des users Partition D
|
||||
FUsers = ""
|
||||
If Fso.FolderExists("d:\Documents And Settings") Then FUsers = "d:\Documents And Settings"
|
||||
If Fso.FolderExists("d:\Users") Then FUsers = "d:\Users"
|
||||
TraceLog LogFile , "FUsers=" & FUsers
|
||||
If FUsers <> "" Then
|
||||
Set fs=Fso.GetFolder(FUsers)
|
||||
Set collfolders = fs.SubFolders
|
||||
For each folder in collfolders
|
||||
curfolder = FUsers & "\" & folder.name
|
||||
OKuser = 0
|
||||
For i = 0 to Ubound(TempUser)
|
||||
If UCase(folder.name) = UCase(TempUser(i)) Then OKuser = 1
|
||||
Next
|
||||
|
||||
If OKuser = 1 Then
|
||||
TraceLog LogFile , "Backup User=" & folder.name
|
||||
TraceLog LogFile , " "
|
||||
call CopyUsers(curfolder)
|
||||
Else
|
||||
TraceLog LogFile , "Exclude User=" & folder.name
|
||||
TraceLog LogFile , " "
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
wscript.Quit(ExitCode)
|
||||
|
||||
' #############################################################################
|
||||
' --------------------- Copy des data Users -----------------------------------
|
||||
Sub CopyUsers(PatchUsers)
|
||||
Temp = Split(VersionNotes,".")
|
||||
|
||||
LectureTransfert = 0
|
||||
set inf= Fso.OpenTextFile(PatchHTA & "USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
TraceLog LogFile , " "
|
||||
If Left(Ligne,1) <> ";" And Ligne <> "" And Left(Ligne,1) <> "[" Then
|
||||
If LectureTransfert = 1 Then
|
||||
Ligne = UCase(Ligne)
|
||||
If Instr(Ligne,"C:\USERS\%USERNAME%") <> 0 Then
|
||||
TraceLog LogFile ,"Ligne:" & Ligne
|
||||
|
||||
' 010877
|
||||
if instr(Ligne,"==") <> 0 Then
|
||||
Templigne = split(Ligne,"==")
|
||||
Ligne = Templigne(0) ' pas de prise en compte de la conversion lors de la sauvegarde
|
||||
TraceLog LogFile , "Ligne==" & Ligne
|
||||
End If
|
||||
|
||||
|
||||
Ligne = Replace(Ligne,"C:\USERS\%USERNAME%",PatchUsers)
|
||||
TraceLog LogFile ,Ligne
|
||||
' verification si extension selectionnée
|
||||
Extention = " "
|
||||
If Instr(Ligne,"\*.") Then
|
||||
Temppath = Split(Ligne,"\*.")
|
||||
Ligne = Temppath(0) 'je garde uniquement le chemin
|
||||
Extention = " *." & Temppath(1) & " " ' j'ajoute *.ext avec le /MIR
|
||||
Else
|
||||
Extention = " " ' je met simplement un espace devant le /MIR
|
||||
End If
|
||||
|
||||
' test DESKTOP et BUREAU pour les postes XP
|
||||
If Instr(Ligne,"\DESKTOP") <> 0 Then
|
||||
If Fso.folderExists(Ligne) = False Then
|
||||
TempLigne = Replace(Ligne, "\DESKTOP", "\BUREAU")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source (DESKTOP)=>" & Source
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' test Documents et Mes document pour les postes XP
|
||||
If Instr(Ligne,"\DOCUMENTS") <> 0 Then
|
||||
If Fso.folderExists(Ligne) = False Then
|
||||
TempLigne = Replace(Ligne, "\DOCUMENTS", "\MES DOCUMENTS")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source(DOCUMENTS)=>" & Source
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
End If
|
||||
|
||||
' test Favorites et favoris pour les postes XP
|
||||
If Instr(Ligne,"\FAVORITES") <> 0 Then
|
||||
If Fso.folderExists(Ligne) = False Then
|
||||
TempLigne = Replace(Ligne, "\FAVORITES", "\FAVORIS")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source(FAVORITES)=>" & Source
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
Else
|
||||
Source = Ligne
|
||||
End If
|
||||
End If
|
||||
|
||||
If Instr(Ligne,"\DESKTOP") = 0 AND Instr(Ligne,"\FAVORITES") = 0 AND Instr(Ligne,"\DOCUMENTS") = 0Then
|
||||
Source = Ligne
|
||||
End If
|
||||
TraceLog LogFile ,"Source final:" & Source
|
||||
|
||||
' Definition du dossier de destinantion
|
||||
TraceLog LogFile , "Destination=>" & FolderBackup & "\" & Ligne
|
||||
Destination = FolderBackup & "\" & Replace(UCase(Ligne), "C:","C")
|
||||
Destination = Replace(UCase(Destination), "D:","C")
|
||||
Destination = UCase(Destination)
|
||||
Destination = Replace(Destination, "\DOCUMENTS AND SETTINGS\", "\USERS\")
|
||||
TraceLog LogFile , "Destination Final=>" & Destination
|
||||
|
||||
If Fso.FolderExists(Source) Then
|
||||
TraceLog LogFile , "Found! " & Source
|
||||
|
||||
Commande = chr(34) & robocopy & chr(34) & " " & Chr(34) & Source & chr(34) & " " & chr(34) & Destination & chr(34) & Extention & "/MIR /R:3" & " /log+:" & chr(34) & LogFile & chr(34)
|
||||
TraceLog LogFile , Commande
|
||||
CodeRetour = Shell.run(Commande,,True)
|
||||
TraceLog LogFile , "EXIT : " & CodeRetour
|
||||
TraceLog LogFile , " "
|
||||
If CodeRetour = 1 then CodeRetour = 0
|
||||
If CodeRetour = 2 then CodeRetour = 0
|
||||
ExitCode = ExitCode + CodeRetour
|
||||
Else
|
||||
TraceLog LogFile , "not Exist " & Source
|
||||
TraceLog LogFile , " "
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
if Instr(UCase(Ligne),"[") <> 0 And Instr(UCase(Ligne),"]") <> 0 Then LectureTransfert = 0
|
||||
If Instr(UCase(Ligne),"[TRANSFERT]") <> 0 Then LectureTransfert = 1
|
||||
Wend
|
||||
inf.close
|
||||
End Sub
|
||||
|
||||
' #############################################################################
|
||||
' --------------------- Fonction ----------------------------------------------
|
||||
Function GetVersion(pathspec)
|
||||
Dim oFso, temp
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
temp = oFso.GetFileVersion(pathspec)
|
||||
If Len(temp) Then
|
||||
GetVersion = temp
|
||||
Else
|
||||
GetVersion = "No version information available."
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline cstr(Date) & " " & cstr(Time) & " | " & Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
|
||||
Function GetPath()
|
||||
Dim path
|
||||
Deftpath = WScript.ScriptFullName
|
||||
GetPath = Left(Deftpath, InStrRev(Deftpath, "\"))
|
||||
End Function
|
||||
418
USMT-Gui-Replace-Scenario/Tools/CustomRestore.vbs
Normal file
418
USMT-Gui-Replace-Scenario/Tools/CustomRestore.vbs
Normal file
@@ -0,0 +1,418 @@
|
||||
Const HKEY_LOCAL_MACHINE = &H80000002
|
||||
|
||||
Dim args, Fso,Shell
|
||||
Set args = Wscript.Arguments
|
||||
Set Fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set Shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Dim FolderBackup, strOs, strArchi, FUsers, PartW, PatchNotes, VersionNotes, LogFile, Temp, UserBackup, ExitCode
|
||||
Dim robocopy
|
||||
ExitCode = 0
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
StrComputerName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
|
||||
|
||||
' --------------------- Chemin fichier INI ------------------------------------
|
||||
PatchHTA = WScript.ScriptFullName
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\") -1)
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\"))
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
if args.count = 0 Then
|
||||
Msgbox "Error Args"
|
||||
Else
|
||||
FolderBackup = args(0)
|
||||
End If
|
||||
|
||||
' --------------------- Detection de l'OS -------------------------------------
|
||||
Set objRegistry=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\default:StdRegProv")
|
||||
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
|
||||
strValueName = "ProductName"
|
||||
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,ProductName
|
||||
strOs = UCase(ProductName)
|
||||
If instr(UCase(ProductName),"WINDOWS XP") <> 0 Then strOs = "Windows_XP"
|
||||
If instr(UCase(ProductName),"WINDOWS 7") <> 0 Then strOs = "Windows_7"
|
||||
If instr(UCase(ProductName),"WINDOWS 8") <> 0 Then strOs = "Windows_8"
|
||||
If instr(UCase(ProductName),"VISTA") <> 0 Then strOs = "windows_vista"
|
||||
If instr(UCase(ProductName),"Windows 10") <> 0 Then strOs = "Windows_10"
|
||||
|
||||
|
||||
' --------------------- Detection de l'architecture ---------------------------
|
||||
strArchi = "x86"
|
||||
If Fso.FolderExists("c:\windows\SysWow64") Then strArchi = "x64"
|
||||
|
||||
|
||||
' --------------------- Detection de la version Lotus Notes ------------------
|
||||
PatchNotes = ""
|
||||
If Fso.FileExists("c:\Program Files\Lotus\Notes\Notes.exe") Then PatchNotes = "c:\Program Files\Lotus\Notes\Notes.exe"
|
||||
If Fso.FileExists("c:\Program Files\Notes\Notes.exe") Then PatchNotes = "c:\Program Files\Notes\Notes.exe"
|
||||
If Fso.FileExists("c:\Program Files (x86)\Lotus\Notes\Notes.exe") Then PatchNotes = "c:\Program Files (x86)\Lotus\Notes\Notes.exe"
|
||||
If Fso.FileExists("c:\Program Files (x86)\Notes\Notes.exe") Then PatchNotes = "c:\Program Files (x86)\Notes\Notes.exe"
|
||||
If PatchNotes <> "" Then
|
||||
VersionNotes = GetVersion(PatchNotes)
|
||||
Else
|
||||
VersionNotes = 0.0
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' #############################################################################
|
||||
LogFile = Left(FolderBackup,Len(FolderBackup) - (Len(FolderBackup) - InstrRev(FolderBackup,"\"))) & Right(FolderBackup,Len(FolderBackup)-InstrRev(FolderBackup,"\")) & "\CustomRestore.log"
|
||||
If Fso.FileExists(LogFile) Then CodeRetour = Fso.deleteFile(LogFile,True)
|
||||
TraceLog LogFile , "#############################################################################"
|
||||
TraceLog LogFile , "#############################################################################"
|
||||
TraceLog LogFile , "FolderBackup=" & FolderBackup
|
||||
TraceLog LogFile , "strOs=" & strOs
|
||||
TraceLog LogFile , "strArchi=" & strArchi
|
||||
TraceLog LogFile , "PatchNotes=" & PatchNotes
|
||||
TraceLog LogFile , "VersionNotes=" & VersionNotes
|
||||
If PatchNotes = "" Then TraceLog LogFile , "Lotus Notes Not Found"
|
||||
|
||||
' Utilisation du robocopy <> si XP sinon on utilise celui natif dans Windows
|
||||
robocopy = "c:\windows\system32\robocopy.exe"
|
||||
if Fso.fileExists("c:\windows\system32\robocopy.exe") then
|
||||
robocopy = "c:\windows\system32\robocopy.exe"
|
||||
Else
|
||||
robocopy = Getpath & "robocopy.exe"
|
||||
End If
|
||||
TraceLog LogFile , "Chemin robocopy :" & robocopy
|
||||
|
||||
' ----------------------- premiere pass pour les dossier non users -----------
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "----------------------- premiere pass pour les dossier non users -----------"
|
||||
LectureTransfert = 0
|
||||
set inf= Fso.OpenTextFile(PatchHTA & "USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
If Left(Ligne,1) <> ";" And Ligne <> "" And Left(Ligne,1) <> "[" Then
|
||||
If LectureTransfert = 1 Then
|
||||
Ligne = UCase(Ligne)
|
||||
|
||||
If Instr(Ligne,"C:\USERS\%USERNAME%") = 0 Then
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "Ligne:" & Ligne
|
||||
|
||||
' verification si extension selectionnée
|
||||
Extention = " "
|
||||
If Instr(Ligne,"\*.") Then
|
||||
Temppath = Split(Ligne,"\*.")
|
||||
Ligne = Temppath(0) 'je garde uniquement le chemin
|
||||
Extention = " *." & Temppath(1) & " "
|
||||
Else
|
||||
Extention = " "
|
||||
End If
|
||||
|
||||
' Si remplacement de chaine
|
||||
If instr(Ligne,"==") <> 0 Then
|
||||
Templigne = split(Ligne,"==")
|
||||
Source = UCase(Templigne(1))
|
||||
Destination=UCase(Templigne(0))
|
||||
TraceLog LogFile , "Source==" & Source
|
||||
TraceLog LogFile , "Destination==" & Destination
|
||||
Else
|
||||
Source = Ligne
|
||||
Destination = Ligne
|
||||
TraceLog LogFile , "Source==" & Source
|
||||
TraceLog LogFile , "Destination==" & Destination
|
||||
End If
|
||||
|
||||
|
||||
' test sur c:\program files et c:\program files (x86)
|
||||
TraceLog LogFile , "Source:" & Source
|
||||
If Instr(Source,"C:\PROGRAM FILES\") <> 0 Then
|
||||
If Fso.folderExists(Source) = False Then
|
||||
TempLigne = Replace(Source, "C:\PROGRAM FILES\", "C:\PROGRAM FILES (X86)\")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source (PROGRAM FILES\)=>" & Source
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
' Definition du dossier de destination
|
||||
|
||||
' fix bug si HDD USB avec lettre D
|
||||
TraceLog LogFile , "Destination:" & Destination
|
||||
TempDestination = ""
|
||||
TempDestination = Replace(UCase(Destination), "C:","C")
|
||||
TempDestination = Replace(UCase(TempDestination), "D:","D")
|
||||
TraceLog LogFile , "TempDestination:" & TempDestination
|
||||
|
||||
Destination = FolderBackup & "\" & TempDestination
|
||||
|
||||
TraceLog LogFile , "Destination Final:" & Destination
|
||||
|
||||
|
||||
If Fso.FolderExists(Destination) Then
|
||||
TraceLog LogFile , "Found! " & Destination
|
||||
Commande = chr(34) & robocopy & chr(34) & " " & Chr(34) & Destination & chr(34) & " " & chr(34) & Source & chr(34) & " /e /R:0 /W:10" & " /log+:" & chr(34) & LogFile & chr(34)
|
||||
TraceLog LogFile , Commande
|
||||
CodeRetour = Shell.run(Commande,,True)
|
||||
TraceLog LogFile , "EXIT : " & CodeRetour
|
||||
TraceLog LogFile , " "
|
||||
If CodeRetour = 1 then CodeRetour = 0
|
||||
If CodeRetour = 2 then CodeRetour = 0
|
||||
If CodeRetour = 3 then CodeRetour = 0
|
||||
ExitCode = ExitCode + CodeRetour
|
||||
Else
|
||||
TraceLog LogFile , "not Exist " & Destination
|
||||
TraceLog LogFile , " "
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
if Instr(UCase(Ligne),"[") <> 0 And Instr(UCase(Ligne),"]") <> 0 Then LectureTransfert = 0
|
||||
If Instr(UCase(Ligne),"[TRANSFERT]") <> 0 Then LectureTransfert = 1
|
||||
Wend
|
||||
inf.close
|
||||
|
||||
|
||||
|
||||
' --------------------- Boucle Users ------------------------------------------
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "--------------------- Boucle Users ------------------------------------------"
|
||||
' Enumeration des users sauvegardés partition C
|
||||
FUsers = ""
|
||||
If Fso.FolderExists("c:\Documents And Settings") Then FUsers = "c:\Documents And Settings"
|
||||
If Fso.FolderExists("c:\Users") Then FUsers = "c:\Users"
|
||||
TraceLog LogFile , "FUsers=" & FUsers
|
||||
if FUsers <> "" Then
|
||||
Set fs=Fso.GetFolder(FUsers)
|
||||
Set collfolders = fs.SubFolders
|
||||
For each folder in collfolders
|
||||
curfolder = FUsers & "\" & folder.name
|
||||
call CopyUsers(curfolder)
|
||||
Next
|
||||
End If
|
||||
|
||||
' Enumeration des users sauvegardés Partition D
|
||||
FUsers = ""
|
||||
If Fso.FolderExists("d:\Documents And Settings") Then FUsers = "d:\Documents And Settings"
|
||||
If Fso.FolderExists("d:\Users") Then FUsers = "d:\Users"
|
||||
TraceLog LogFile , "FUsers=" & FUsers
|
||||
If FUsers <> "" Then
|
||||
Set fs=Fso.GetFolder(FUsers)
|
||||
Set collfolders = fs.SubFolders
|
||||
For each folder in collfolders
|
||||
curfolder = FUsers & "\" & folder.name
|
||||
call CopyUsers(curfolder)
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' Set des password
|
||||
on error resume next
|
||||
LecturePassword = 0
|
||||
setpassword = "NO"
|
||||
newpassword = ""
|
||||
Excludeuser = ""
|
||||
set inf= Fso.OpenTextFile(PatchHTA & "USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
if LecturePassword = 1 Then
|
||||
If Instr(UCase(Ligne),"SETPASSWORD") <> 0 Then
|
||||
If Instr(Ligne,"=") <> 0 Then
|
||||
Temp3 = Split(Ligne,"=")
|
||||
setpassword = Temp3(1)
|
||||
End If
|
||||
End If
|
||||
|
||||
If Instr(UCase(Ligne),"NEWPASSWORD") <> 0 Then
|
||||
If Instr(Ligne,"=") <> 0 Then
|
||||
Temp3 = Split(Ligne,"=")
|
||||
newpassword = Temp3(1)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Instr(UCase(Ligne),"EXCLUDEUSER") <> 0 Then
|
||||
If Instr(Ligne,"=") <> 0 Then
|
||||
Temp3 = Split(Ligne,"=")
|
||||
Excludeuser = Temp3(1)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
If UCase(Ligne) = "[PASSWORD]" Then LecturePassword = 1
|
||||
Wend
|
||||
inf.close
|
||||
TraceLog LogFile , " "
|
||||
TraceLog LogFile , "--------------------------------------------------"
|
||||
TraceLog LogFile , "setpassword = " & setpassword
|
||||
TraceLog LogFile , "newpassword = " & newpassword
|
||||
TraceLog LogFile , "Excludeuser = " & Excludeuser
|
||||
|
||||
If UCAse(setpassword) = "YES" and newpassword <> "" And Excludeuser <> "" Then
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2")
|
||||
Set colItems = objWMIService.ExecQuery ("Select * from Win32_UserAccount Where LocalAccount = True")
|
||||
|
||||
For Each objItem in colItems
|
||||
If Instr(UCase(Excludeuser),"," & UCase(objItem.Name) & ",") = 0 Then
|
||||
Command1 = "net user " & chr(34) & objItem.Name & chr(34) & " " & newpassword
|
||||
TraceLog LogFile , Command1
|
||||
CodeRetour = Shell.run("cmd /c " & Command1,0,True)
|
||||
ExitCode = ExitCode + CodeRetour
|
||||
TraceLog LogFile , "Exit : " & CodeRetour
|
||||
Else
|
||||
TraceLog LogFile , "Exclude = " & objItem.Name
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
wscript.Quit(ExitCode)
|
||||
|
||||
|
||||
|
||||
' #############################################################################
|
||||
' --------------------- Restore des data Users --------------------------------
|
||||
Sub CopyUsers(PatchUsers)
|
||||
Temp = Split(VersionNotes,".")
|
||||
|
||||
LectureTransfert = 0
|
||||
set inf= Fso.OpenTextFile(PatchHTA & "USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
If Left(Ligne,1) <> ";" And Ligne <> "" And Left(Ligne,1) <> "[" Then
|
||||
If LectureTransfert = 1 Then
|
||||
Ligne = UCase(Ligne)
|
||||
|
||||
If Instr(Ligne,"C:\USERS\%USERNAME%") <> 0 Then
|
||||
|
||||
TraceLog LogFile , " "
|
||||
Ligne = Replace(Ligne,"C:\USERS\%USERNAME%",PatchUsers)
|
||||
TraceLog LogFile ,"Ligne:" & Ligne
|
||||
' verification si extension selectionnée
|
||||
Extention = " "
|
||||
If Instr(Ligne,"\*.") Then
|
||||
Temppath = Split(Ligne,"\*.")
|
||||
Ligne = Temppath(0) 'je garde uniquement le chemin
|
||||
Extention = " *." & Temppath(1) & " "
|
||||
Else
|
||||
Extention = " "
|
||||
End If
|
||||
|
||||
|
||||
' 010877
|
||||
' Si remplacement de chaine
|
||||
If instr(Ligne,"==") <> 0 Then
|
||||
Templigne = split(Ligne,"==")
|
||||
Source = UCase(Templigne(1))
|
||||
Destination=UCase(Templigne(0))
|
||||
TraceLog LogFile , "Source==" & Source
|
||||
TraceLog LogFile , "Destination==" & Destination
|
||||
Else
|
||||
Source = Ligne
|
||||
Destination = Ligne
|
||||
TraceLog LogFile , "Source==" & Source
|
||||
TraceLog LogFile , "Destination==" & Destination
|
||||
End If
|
||||
|
||||
|
||||
|
||||
TraceLog LogFile , "Check =>" & Source
|
||||
' test DESKTOP et BUREAU pour les postes XP
|
||||
If Instr(Source,"\DESKTOP") <> 0 Then
|
||||
If Fso.folderExists(Source) = False Then
|
||||
TempLigne = Replace(Source, "\DESKTOP", "\BUREAU")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source(DESKTOP)=>" & Source
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
' test Documents et Mes document pour les postes XP
|
||||
If Instr(Source,"\DOCUMENTS") <> 0 Then
|
||||
If Fso.folderExists(Source) = False Then
|
||||
TempLigne = Replace(Source, "\DOCUMENTS", "\MES DOCUMENTS")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source(DOCUMENTS)=>" & Source
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
' test Favorites et favoris pour les postes XP
|
||||
If Instr(Source,"\FAVORITES") <> 0 Then
|
||||
If Fso.folderExists(Source) = False Then
|
||||
TempLigne = Replace(Source, "\FAVORITES", "\FAVORIS")
|
||||
If Fso.FolderExists(TempLigne) Then
|
||||
Source = TempLigne
|
||||
TraceLog LogFile , "Remplace Source(FAVORITES)=>" & Source
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
TraceLog LogFile ,"Source final:" & Source
|
||||
|
||||
' Definition du dossier de destinantion
|
||||
TraceLog LogFile , "Destination=>" & Destination
|
||||
|
||||
' fix bug si HDD USB avec lettre D
|
||||
TempDestination = ""
|
||||
TempDestination = Replace(UCase(Destination), "C:","C")
|
||||
TempDestination = Replace(UCase(TempDestination), "D:","C")
|
||||
|
||||
TraceLog LogFile , "TempDestination=>" & TempDestination
|
||||
|
||||
Destination = FolderBackup & "\" & TempDestination
|
||||
Destination = UCase(Destination)
|
||||
Destination = Replace(Destination, "\DOCUMENTS AND SETTINGS\", "\USERS\")
|
||||
TraceLog LogFile , "Destination Final=>" & Destination
|
||||
|
||||
|
||||
|
||||
|
||||
If Fso.FolderExists(Destination) Then
|
||||
TraceLog LogFile , "Found! " & Destination
|
||||
|
||||
Commande = chr(34) & robocopy & chr(34) & " " & chr(34) & Destination & chr(34) & " " & chr(34) & Source & chr(34) & " /e /R:0 /W:10" & " /log+:" & chr(34) & LogFile & chr(34)
|
||||
TraceLog LogFile , Commande
|
||||
|
||||
CodeRetour = Shell.run(Commande,,True)
|
||||
TraceLog LogFile , "EXIT : " & CodeRetour
|
||||
TraceLog LogFile , " "
|
||||
If CodeRetour = 1 then CodeRetour = 0
|
||||
If CodeRetour = 2 then CodeRetour = 0
|
||||
If CodeRetour = 3 then CodeRetour = 0
|
||||
ExitCode = ExitCode + CodeRetour
|
||||
Else
|
||||
TraceLog LogFile , "not Exist " & Destination
|
||||
TraceLog LogFile , " "
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
if Instr(UCase(Ligne),"[") <> 0 And Instr(UCase(Ligne),"]") <> 0 Then LectureTransfert = 0
|
||||
If Instr(UCase(Ligne),"[TRANSFERT]") <> 0 Then LectureTransfert = 1
|
||||
Wend
|
||||
inf.close
|
||||
|
||||
End Sub
|
||||
' #############################################################################
|
||||
' --------------------- Fonction ----------------------------------------------
|
||||
Function GetVersion(pathspec)
|
||||
Dim oFso, temp
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
temp = oFso.GetFileVersion(pathspec)
|
||||
If Len(temp) Then
|
||||
GetVersion = temp
|
||||
Else
|
||||
GetVersion = "No version information available."
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline cstr(Date) & " " & cstr(Time) & " | " & Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
|
||||
Function GetPath()
|
||||
Dim path
|
||||
Deftpath = WScript.ScriptFullName
|
||||
GetPath = Left(Deftpath, InStrRev(Deftpath, "\"))
|
||||
End Function
|
||||
180
USMT-Gui-Replace-Scenario/Tools/GetLicenceAdobe.vbs
Normal file
180
USMT-Gui-Replace-Scenario/Tools/GetLicenceAdobe.vbs
Normal file
@@ -0,0 +1,180 @@
|
||||
'Modified by Travis Smith (wpsmith.net) to fetch all Adobe licenses.
|
||||
|
||||
'To run this program make sure that sqlite3.exe is in the same folder as this vbs file.
|
||||
'SQLITE3 source and binaries can be found at www.sqlite.org
|
||||
|
||||
|
||||
'Variable Declarations
|
||||
Dim objFSO, objShell, objEM
|
||||
Dim strCacheFile, strCurrentDirectory, strCommand, strSQLlite, strLine, strAdobeEncryptedKey, strAdobeKey, strFile
|
||||
Dim arrTemp1, arrTemp2
|
||||
Dim csvFile
|
||||
|
||||
Dim args
|
||||
Set args = Wscript.Arguments
|
||||
Argument1 = args(0)
|
||||
|
||||
|
||||
'Objects: FileSystem & Shell
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
Set objNetwork = CreateObject("Wscript.Network")
|
||||
|
||||
|
||||
'Adobe Cache DB File
|
||||
If objFSO.FileExists("C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\cache\cache.db") Then strCacheFile = "C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\cache\cache.db"
|
||||
If objFSO.FileExists("C:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db") Then strCacheFile = "C:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db"
|
||||
strCacheFile = FindCacheFile(strCacheFile)
|
||||
|
||||
|
||||
'Set Curret Directory
|
||||
strCurrentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))
|
||||
|
||||
|
||||
'Location of SQLite
|
||||
strSQLlite = strCurrentDirectory & "sqlite3.exe"
|
||||
msgbox strSQLlite
|
||||
|
||||
'Command: Get Product Name & Key
|
||||
strCommand = strSQLlite & " " & Chr(34) & strCacheFile & Chr(34) & " " & chr(34) & "SELECT subDomain,value FROM domain_data WHERE key='SN' OR key='EncryptedSerial';" & chr(34)
|
||||
Set objOutput = objShell.Exec (strCommand)
|
||||
|
||||
|
||||
'Prep output text
|
||||
strOutput = ""
|
||||
Do While Not objOutput.StdOut.AtEndOfStream
|
||||
'Read line
|
||||
strLine = objOutput.StdOut.Readline
|
||||
|
||||
'Get Product
|
||||
arrTemp1 = Split(strLine,"{|}")
|
||||
strProduct = arrTemp1(0)
|
||||
|
||||
If IsArray(arrTemp1) Then
|
||||
If UBound(arrTemp1) >= 0 Then
|
||||
Msgbox("Not Empty")
|
||||
arrTemp2 = Split(arrTemp1(1),"|")
|
||||
Else
|
||||
Msgbox("Empty")
|
||||
arrTemp2 = Split(strLine,"|")
|
||||
End If
|
||||
Else
|
||||
Msgbox("---Empty")
|
||||
End If
|
||||
strAdobeEncryptedKey = arrTemp2(1)
|
||||
strAdobeKey = DecodeAdobeKey(strAdobeEncryptedKey)
|
||||
|
||||
|
||||
'Output to screen
|
||||
wscript.echo "Your Adobe " & strProduct & " License Key is: " & strAdobeKey
|
||||
CodeRetour = tracelog(Argument1 & "\GetLicenceAdobe.txt", strAdobeKey)
|
||||
Loop
|
||||
|
||||
'Email File
|
||||
'Set objEM = EmailAdobeKey(strOutput,strFile)
|
||||
|
||||
Function IsArrayDimmed(arr)
|
||||
IsArrayDimmed = False
|
||||
If IsArray(arr) Then
|
||||
On Error Resume Next
|
||||
Dim ub : ub = UBound(arr)
|
||||
If (Err.Number = 0) And (ub >= 0) Then IsArrayDimmed = True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function EmailAdobeKey(strText, strFile)
|
||||
Set objSysInfo = CreateObject("ADSystemInfo")
|
||||
Set objOutlookApp = CreateObject("Outlook.Application")
|
||||
Set objMailItem = objOutlookApp.CreateItem(olMailItem)
|
||||
'comment the next line If you do Not want to see the outlook window
|
||||
objMailItem.Display
|
||||
objMailItem.Recipients.Add "travis.smith@ups.com"
|
||||
objMailItem.Subject = "Adobe Licenses"
|
||||
objMailItem.Body = "Hello," & vbCrLf & "Attached are my Adobe License Keys: " & strText & vbCrLf & "Thanks," & vbCrLf & objSysInfo.UserName
|
||||
objMailItem.Attachments.Add strFile
|
||||
objMailItem.Send
|
||||
|
||||
Set objSysInfo = Nothing
|
||||
Set objOutlookApp = Nothing
|
||||
Set objMailItem = Nothing
|
||||
Set EmailAdobeKey = Nothing
|
||||
Msgbox "Completed!",vbokonly,"Done"
|
||||
End Function
|
||||
|
||||
|
||||
Function DecodeAdobeKey(strAdobeEncryptedKey)
|
||||
Dim AdobeCipher(24)
|
||||
Dim strAdobeDecryptedKey
|
||||
|
||||
AdobeCipher(0) = "0000000001"
|
||||
AdobeCipher(1) = "5038647192"
|
||||
AdobeCipher(2) = "1456053789"
|
||||
AdobeCipher(3) = "2604371895"
|
||||
AdobeCipher(4) = "4753896210"
|
||||
AdobeCipher(5) = "8145962073"
|
||||
AdobeCipher(6) = "0319728564"
|
||||
AdobeCipher(7) = "7901235846"
|
||||
AdobeCipher(8) = "7901235846"
|
||||
AdobeCipher(9) = "0319728564"
|
||||
AdobeCipher(10) = "8145962073"
|
||||
AdobeCipher(11) = "4753896210"
|
||||
AdobeCipher(12) = "2604371895"
|
||||
AdobeCipher(13) = "1426053789"
|
||||
AdobeCipher(14) = "5038647192"
|
||||
AdobeCipher(15) = "3267408951"
|
||||
AdobeCipher(16) = "5038647192"
|
||||
AdobeCipher(17) = "2604371895"
|
||||
AdobeCipher(18) = "8145962073"
|
||||
AdobeCipher(19) = "7901235846"
|
||||
AdobeCipher(20) = "3267408951"
|
||||
AdobeCipher(21) = "1426053789"
|
||||
AdobeCipher(22) = "4753896210"
|
||||
AdobeCipher(23) = "0319728564"
|
||||
|
||||
'decode the adobe key
|
||||
for i = 0 To 23
|
||||
if (i Mod 4 = 0 And i > 0) Then
|
||||
'every 4 characters add a "-"
|
||||
strAdobeDecryptedKey = strAdobeDecryptedKey & "-"
|
||||
end if
|
||||
|
||||
'Grab the next number from the adobe encrypted key. Add one to 'i' because it isn't base 0
|
||||
j = mid (strAdobeEncryptedKey, i + 1, 1)
|
||||
|
||||
'Add one to J because it isn't base 0 and grab that numbers position in the cipher
|
||||
k = mid (AdobeCipher(i), j + 1, 1)
|
||||
|
||||
strAdobeDecryptedKey = strAdobeDecryptedKey & k
|
||||
Next
|
||||
|
||||
DecodeAdobeKey = strAdobeDecryptedKey
|
||||
End Function
|
||||
|
||||
|
||||
Function FindCacheFile(CacheFile)
|
||||
If (Not CacheFile = "") And (objFSO.FileExists(CacheFile)) Then
|
||||
FindCacheFile = CacheFile
|
||||
ElseIf objFSO.FileExists("c:\Program Files (x86)\Common Files\Adobe\Adobe PCD\cache\cache.db") Then
|
||||
FindCacheFile = "c:\Program Files (x86)\Common Files\Adobe\Adobe PCD\cache\cache.db"
|
||||
ElseIf objFSO.FileExists("c:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db") Then
|
||||
FindCacheFile = "c:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db"
|
||||
Else
|
||||
wscript.echo "Can't find the cache.db file"
|
||||
wscript.quit
|
||||
End IF
|
||||
End Function
|
||||
|
||||
' ********** Fonction **********************************************************************************************
|
||||
Function GetPath()
|
||||
Dim path
|
||||
path = WScript.ScriptFullName
|
||||
GetPath = Left(path, InStrRev(path, "\"))
|
||||
End Function
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline cstr(Date) & " " & cstr(Time) & " | " & Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
103
USMT-Gui-Replace-Scenario/Tools/GetLicenceOffice.vbs
Normal file
103
USMT-Gui-Replace-Scenario/Tools/GetLicenceOffice.vbs
Normal file
@@ -0,0 +1,103 @@
|
||||
CONST HKEY_LOCAL_MACHINE = &H80000002
|
||||
CONST SEARCH_KEY = "DigitalProductID"
|
||||
|
||||
Dim args
|
||||
Set args = Wscript.Arguments
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
|
||||
Argument1 = args(0)
|
||||
|
||||
Dim arrSubKeys(6,1)
|
||||
Dim foundKeys
|
||||
Dim iValues, arrDPID
|
||||
foundKeys = Array()
|
||||
iValues = Array()
|
||||
strComputer = "."
|
||||
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor")
|
||||
For Each objProcessor in colProcessors
|
||||
Select Case objProcessor.AddressWidth
|
||||
Case 32
|
||||
arrSubKeys(2,0) = "Microsoft Office XP"
|
||||
arrSubKeys(2,1) = "SOFTWARE\Microsoft\Office\10.0\Registration"
|
||||
arrSubKeys(1,0) = "Microsoft Office 2003"
|
||||
arrSubKeys(1,1) = "SOFTWARE\Microsoft\Office\11.0\Registration"
|
||||
arrSubKeys(3,0) = "Microsoft Office 2007"
|
||||
arrSubKeys(3,1) = "SOFTWARE\Microsoft\Office\12.0\Registration"
|
||||
arrSubKeys(4,0) = "Microsoft Office 2010"
|
||||
arrSubKeys(4,1) = "SOFTWARE\Microsoft\Office\14.0\Registration"
|
||||
Case 64
|
||||
arrSubKeys(2,0) = "Microsoft Office XP"
|
||||
arrSubKeys(2,1) = "SOFTWARE\Wow6432Node\Microsoft\Office\10.0\Registration"
|
||||
arrSubKeys(1,0) = "Microsoft Office 2003"
|
||||
arrSubKeys(1,1) = "SOFTWARE\Wow6432Node\Microsoft\Office\11.0\Registration"
|
||||
arrSubKeys(3,0) = "Microsoft Office 2007"
|
||||
arrSubKeys(3,1) = "SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Registration"
|
||||
arrSubKeys(4,0) = "Microsoft Office 2010"
|
||||
arrSubKeys(4,1) = "SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Registration"
|
||||
End Select
|
||||
next
|
||||
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
|
||||
|
||||
For x = 1 To 4
|
||||
oReg.GetBinaryValue HKEY_LOCAL_MACHINE, arrSubKeys(x,1), SEARCH_KEY, arrDPIDBytes
|
||||
If Not IsNull(arrDPIDBytes) Then
|
||||
call decodeKey(arrDPIDBytes, arrSubKeys(x,0))
|
||||
Else
|
||||
oReg.EnumKey HKEY_LOCAL_MACHINE, arrSubKeys(x,1), arrGUIDKeys
|
||||
If Not IsNull(arrGUIDKeys) Then
|
||||
For Each GUIDKey In arrGUIDKeys
|
||||
oReg.GetBinaryValue HKEY_LOCAL_MACHINE, arrSubKeys(x,1) & "\" & GUIDKey, SEARCH_KEY, arrDPIDBytes
|
||||
If Not IsNull(arrDPIDBytes) Then
|
||||
CodeRetour = tracelog(Argument1 & "\GetLicenceOffice.txt", arrSubKeys(x,0))
|
||||
call decodeKey(arrDPIDBytes, arrSubKeys(x,0))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Function decodeKey(iValues, strProduct)
|
||||
Dim arrDPID
|
||||
arrDPID = Array()
|
||||
|
||||
For i = 52 to 66
|
||||
ReDim Preserve arrDPID( UBound(arrDPID) + 1 )
|
||||
arrDPID( UBound(arrDPID) ) = iValues(i)
|
||||
Next
|
||||
Dim arrChars
|
||||
arrChars = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9")
|
||||
|
||||
For i = 24 To 0 Step -1
|
||||
k = 0
|
||||
For j = 14 To 0 Step -1
|
||||
k = k * 256 Xor arrDPID(j)
|
||||
arrDPID(j) = Int(k / 24)
|
||||
k = k Mod 24
|
||||
Next
|
||||
strProductKey = arrChars(k) & strProductKey
|
||||
If i Mod 5 = 0 And i <> 0 Then strProductKey = "-" & strProductKey
|
||||
Next
|
||||
|
||||
ReDim Preserve foundKeys( UBound(foundKeys) + 1 )
|
||||
foundKeys( UBound(foundKeys) ) = strProductKey
|
||||
strKey = UBound(foundKeys)
|
||||
wscript.echo ( "Product(license) key is " & foundKeys(strKey))
|
||||
CodeRetour = tracelog(Argument1 & "\GetLicenceOffice.txt", foundKeys(strKey))
|
||||
End Function
|
||||
|
||||
' ********** Fonction **********************************************************************************************
|
||||
Function GetPath()
|
||||
Dim path
|
||||
path = WScript.ScriptFullName
|
||||
GetPath = Left(path, InStrRev(path, "\"))
|
||||
End Function
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
62
USMT-Gui-Replace-Scenario/Tools/ListPrinters.vbs
Normal file
62
USMT-Gui-Replace-Scenario/Tools/ListPrinters.vbs
Normal file
@@ -0,0 +1,62 @@
|
||||
Const ForAppending = 8
|
||||
Const ForReading = 1
|
||||
|
||||
Dim WshNetwork, objPrinter, intDrive, intNetLetter
|
||||
|
||||
Dim args
|
||||
Set args = Wscript.Arguments
|
||||
If args.count = 0 then
|
||||
Argument1 = Left(GetPath,len(GetPath) -1)
|
||||
Else
|
||||
Argument1 = args(0)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
filOutput = Argument1 & "\printers.csv"
|
||||
If objFSO.FileExists(filOutput) Then objFSO.DeleteFile(filOutput)
|
||||
|
||||
Dim objWMIService, objItem, colItems, strComputer, intPrinters
|
||||
|
||||
Set objOutputFile = objFSO.OpenTextFile (filOutput, ForAppending, True)
|
||||
objOutputFile.WriteLine( "Printers " & ";" & _
|
||||
"Printer: " & ";" & _
|
||||
"Driver Name: " & ";" & _
|
||||
"Port Name: " & ";" & _
|
||||
"Published: " & ";" & _
|
||||
"ShareName: " & ";" & _
|
||||
"Location: " & ";" & _
|
||||
"Work Offline: ")
|
||||
|
||||
|
||||
|
||||
Set objWMIService = GetObject ("winmgmts:\\" & "." & "\root\CIMV2")
|
||||
Set colItems = objWMIService.ExecQuery ("SELECT * FROM Win32_Printer")
|
||||
For Each objItem In colItems
|
||||
objOutputFile.WriteLine( objItem.name & ";" & _
|
||||
objItem.DeviceID & ";" & _
|
||||
objItem.DriverName & ";" & _
|
||||
objItem.PortName & ";" & _
|
||||
objItem.Published & ";" & _
|
||||
objItem.ShareName & ";" & _
|
||||
objItem.Location & ";" & _
|
||||
objItem.WorkOffline )
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
objOutputFile.close
|
||||
|
||||
|
||||
Function GetPath()
|
||||
Dim path
|
||||
Deftpath = WScript.ScriptFullName
|
||||
GetPath = Left(Deftpath, InStrRev(Deftpath, "\"))
|
||||
End Function
|
||||
BIN
USMT-Gui-Replace-Scenario/Tools/MigViewer.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/MigViewer.exe
Normal file
Binary file not shown.
94
USMT-Gui-Replace-Scenario/Tools/USMTExcludeDrives.vbs
Normal file
94
USMT-Gui-Replace-Scenario/Tools/USMTExcludeDrives.vbs
Normal file
@@ -0,0 +1,94 @@
|
||||
Set oFSO = CreateObject("Scripting.FileSystemObject")
|
||||
Set Shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Const TRISTATE_USE_DEFAULT = -2
|
||||
Const TRISTATE_TRUE = -1
|
||||
Const TRISTATE_FALSE = 0
|
||||
|
||||
Const OVERWRITE_TRUE = -1
|
||||
Const OVERWRITE_FALSE = 0
|
||||
|
||||
Const LOCATION_MODIFY_TRUE = -1
|
||||
Const LOCATION_MODIFY_FALSE = 0
|
||||
|
||||
Const TEXT_USE_DEFAULT = -2
|
||||
Const TEXT_UNICODE = -1 'Open the file as Unicode.
|
||||
Const TEXT_ASCII = 0 'Open the file as ASCII.
|
||||
Dim TabUSB
|
||||
Redim TabUSB(0)
|
||||
|
||||
If oFSO.FileExists(GetPath & "USMTExcludeDrives.xml") Then CodeRetour = oFSO.DeleteFile(GetPath & "USMTExcludeDrives.xml")
|
||||
|
||||
StrComputerName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
|
||||
TraceLog GetPath & "USMTExcludeDrives.log", StrComputerName & " | " & "Start"
|
||||
|
||||
'Show drive letters associated with each
|
||||
ComputerName = "."
|
||||
Set wmiServices = GetObject ("winmgmts:{impersonationLevel=Impersonate}!//" & ComputerName)
|
||||
' Get physical disk drive
|
||||
Set wmiDiskDrives = wmiServices.ExecQuery ( "SELECT Caption, DeviceID FROM Win32_DiskDrive WHERE InterfaceType = 'USB'")
|
||||
|
||||
For Each wmiDiskDrive In wmiDiskDrives
|
||||
query = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" & wmiDiskDrive.DeviceID & "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition"
|
||||
Set wmiDiskPartitions = wmiServices.ExecQuery(query)
|
||||
|
||||
For Each wmiDiskPartition In wmiDiskPartitions
|
||||
'Use partition device id to find logical disk
|
||||
Set wmiLogicalDisks = wmiServices.ExecQuery ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" & wmiDiskPartition.DeviceID & "'} WHERE AssocClass = Win32_LogicalDiskToPartition")
|
||||
x = ""
|
||||
For Each wmiLogicalDisk In wmiLogicalDisks
|
||||
TabUSB(Ubound(TabUSB)) = wmiLogicalDisk.DeviceID
|
||||
Redim preserve tabUSB(Ubound(TabUSB)+1)
|
||||
TraceLog GetPath & "USMTExcludeDrives.log", StrComputerName & " | " & "USB=" & wmiLogicalDisk.DeviceID
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
|
||||
If Ubound(TabUSB) > 0 Then
|
||||
|
||||
Set oFile = oFSO.CreateTextFile(GetPath & "USMTExcludeDrives.xml", OVERWRITE_TRUE, TEXT_UNICODE)
|
||||
|
||||
oFile.WriteLine "<?xml version=""1.0"" encoding=""UTF-16""?>"
|
||||
oFile.WriteLine "<migration urlid=""http://www.microsoft.com/migration/1.0/migxmlext/MigExcludeDrives"">"
|
||||
oFile.WriteLine ""
|
||||
oFile.WriteLine " <_locDefinition>"
|
||||
oFile.WriteLine " <_locDefault _loc=""locNone""/>"
|
||||
oFile.WriteLine " <_locTag _loc=""locData"">displayName</_locTag>"
|
||||
oFile.WriteLine " </_locDefinition>"
|
||||
oFile.WriteLine " <component type=""Documents"" context=""UserAndSystem"">"
|
||||
oFile.WriteLine " <displayName _locID=""migexcludedrives.excludedrives"">Unconditional Exclude Drives</displayName>"
|
||||
oFile.WriteLine " <role role=""Data"">"
|
||||
oFile.WriteLine " <rules>"
|
||||
oFile.WriteLine " <unconditionalExclude>"
|
||||
oFile.WriteLine " <objectSet>"
|
||||
' <pattern type="File">H:\* [*]</pattern>
|
||||
For i = 0 To (Ubound(TabUSB)-1)
|
||||
oFile.WriteLine " <pattern type=""File"">" & UCase(TabUSB(i)) & "\* [*]</pattern>"
|
||||
Next
|
||||
|
||||
|
||||
oFile.WriteLine " </objectSet>"
|
||||
oFile.WriteLine " </unconditionalExclude>"
|
||||
oFile.WriteLine " </rules>"
|
||||
oFile.WriteLine " </role>"
|
||||
oFile.WriteLine " </component>"
|
||||
oFile.WriteLine "</migration>"
|
||||
oFile.Close
|
||||
TraceLog GetPath & "USMTExcludeDrives.log", StrComputerName & " | " & "Fin de creation du xml"
|
||||
Else
|
||||
TraceLog GetPath & "USMTExcludeDrives.log", StrComputerName & " | " & "Pas de disque USB"
|
||||
End If
|
||||
|
||||
Function GetPath()
|
||||
Dim path
|
||||
path = WScript.ScriptFullName
|
||||
GetPath = Left(path, InStrRev(path, "\"))
|
||||
End Function
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline cstr(Date) & " " & cstr(Time) & " | " & Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
BIN
USMT-Gui-Replace-Scenario/Tools/USMTExcludeDrives.xml
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/USMTExcludeDrives.xml
Normal file
Binary file not shown.
BIN
USMT-Gui-Replace-Scenario/Tools/blat.dll
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/blat.dll
Normal file
Binary file not shown.
BIN
USMT-Gui-Replace-Scenario/Tools/blat.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/blat.exe
Normal file
Binary file not shown.
BIN
USMT-Gui-Replace-Scenario/Tools/blat.lib
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/blat.lib
Normal file
Binary file not shown.
199
USMT-Gui-Replace-Scenario/Tools/blat.txt
Normal file
199
USMT-Gui-Replace-Scenario/Tools/blat.txt
Normal file
@@ -0,0 +1,199 @@
|
||||
Blat v3.2.12 (build : Dec 4 2015 19:32:55)
|
||||
32-bit Windows, Full, Unicode
|
||||
|
||||
Windows console utility to send mail via SMTP or post to usenet via NNTP
|
||||
by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde
|
||||
http://www.blat.net
|
||||
syntax:
|
||||
Blat <filename> -to <recipient> [optional switches (see below)]
|
||||
|
||||
Blat -SaveSettings -f <sender email addy> -server <server addr>
|
||||
[-port <port>] [-try <try>] [-profile <profile>]
|
||||
[-u <login id>] [-pw <password>]
|
||||
or
|
||||
Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q]
|
||||
|
||||
Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q]
|
||||
Blat -h
|
||||
|
||||
-------------------------------- Installation ---------------------------------
|
||||
-SaveSettings : store common settings to the Windows Registry. Takes the
|
||||
same parameters as -install, and is only for SMTP settings.
|
||||
-install[SMTP|NNTP|POP3|IMAP] <server addr> <sender email addr> [<try n times>
|
||||
[<port> [<profile> [<username> [<password>]]]]]
|
||||
: set server, sender, number of tries and port for profile
|
||||
(<try n times> and <port> may be replaced by '-')
|
||||
port defaults are SMTP=25, NNTP=119, POP3=110, IMAP=143
|
||||
default profile can be specified with a '-'
|
||||
username and/or password may be stored to the registry
|
||||
order of options is specific
|
||||
use -installNNTP for storing NNTP information
|
||||
use -installPOP3 for storing POP3 information
|
||||
(sender and try are ignored, use '-' in place of these)
|
||||
use -installIMAP for storing IMAP information
|
||||
(sender and try are ignored, use '-' in place of these)
|
||||
|
||||
--------------------------------- The Basics ----------------------------------
|
||||
<filename> : file with the message body to be sent
|
||||
if your message body is on the command line, use a hyphen (-)
|
||||
as your first argument, and -body followed by your message
|
||||
if your message will come from the console/keyboard, use the
|
||||
hyphen as your first argument, but do not use -body option.
|
||||
-of <file> : text file containing more options (also -optionfile)
|
||||
-to <recipient> : recipient list (also -t) (comma separated)
|
||||
-tf <file> : recipient list filename
|
||||
-cc <recipient> : carbon copy recipient list (also -c) (comma separated)
|
||||
-cf <file> : cc recipient list filename
|
||||
-bcc <recipient>: blind carbon copy recipient list (also -b)
|
||||
(comma separated)
|
||||
-bf <file> : bcc recipient list filename
|
||||
-maxNames <x> : send to groups of <x> number of recipients
|
||||
-ur : set To: header to Undisclosed Recipients if not using the
|
||||
-to and -cc options
|
||||
-subject <subj> : subject line, surround with quotes to include spaces(also -s)
|
||||
-ss : suppress subject line if not defined
|
||||
-sf <file> : file containing subject line
|
||||
-bodyF <file> : file containing the message body
|
||||
-body <text> : message body, surround with quotes (") to include spaces
|
||||
-sig <file> : text file containing your email signature
|
||||
-tag <file> : text file containing taglines, to be randomly chosen
|
||||
-ps <file> : final message text, possibly for unsubscribe instructions
|
||||
|
||||
----------------------------- Registry overrides ------------------------------
|
||||
-p <profile> : send with server, user, and port defined in <profile>
|
||||
: use username and password if defined in <profile>
|
||||
-profile : list all profiles in the Registry
|
||||
-server <addr> : specify SMTP server to be used (optionally, addr:port)
|
||||
-serverSMTP <addr>
|
||||
: same as -server
|
||||
-serverNNTP <addr>
|
||||
: specify NNTP server to be used (optionally, addr:port)
|
||||
-serverPOP3 <addr>
|
||||
: specify POP3 server to be used (optionally, addr:port)
|
||||
when POP3 access is required before sending email
|
||||
-serverIMAP <addr>
|
||||
: specify IMAP server to be used (optionally, addr:port)
|
||||
when IMAP access is required before sending email
|
||||
-f <sender> : override the default sender address (must be known to server)
|
||||
-i <addr> : a 'From:' address, not necessarily known to the server
|
||||
-port <port> : port to be used on the SMTP server, defaults to SMTP (25)
|
||||
-portSMTP <port>: same as -port
|
||||
-portNNTP <port>: port to be used on the NNTP server, defaults to NNTP (119)
|
||||
-portPOP3 <port>: port to be used on the POP3 server, defaults to POP3 (110)
|
||||
-portIMAP <port>: port to be used on the IMAP server, defaults to IMAP (110)
|
||||
-u <username> : username for AUTH LOGIN (use with -pw)
|
||||
or for AUTH GSSAPI with -k
|
||||
-pw <password> : password for AUTH LOGIN (use with -u)
|
||||
-pu <username> : username for POP3 LOGIN (use with -ppw)
|
||||
-ppw <password> : password for POP3 LOGIN (use with -pu)
|
||||
-iu <username> : username for IMAP LOGIN (use with -ipw)
|
||||
-ipw <password> : password for IMAP LOGIN (use with -iu)
|
||||
-k : Use UNKNOWN mutual authentication and AUTH GSSAPI
|
||||
-kc : Use UNKNOWN client-only authentication and AUTH GSSAPI
|
||||
-service <name> : Set GSSAPI service name (use with -k), default "smtp@server"
|
||||
-level <lev> : Set GSSAPI protection level to <lev>, which should be one of
|
||||
: None, Integrity, or Privacy (default GSSAPI level is Privacy)
|
||||
-nomd5 : Do NOT use CRAM-MD5 authentication. Use this in cases where
|
||||
the server's CRAM-MD5 is broken, such as Network Solutions.
|
||||
|
||||
---------------------- Miscellaneous RFC header switches ----------------------
|
||||
-organization <organization>
|
||||
: Organization field (also -o and -org)
|
||||
-ua : include User-Agent header line instead of X-Mailer
|
||||
-x <X-Header: detail>
|
||||
: custom 'X-' header. eg: -x "X-INFO: Blat is Great!"
|
||||
-noh : prevent X-Mailer/User-Agent header from showing Blat homepage
|
||||
-noh2 : prevent X-Mailer header entirely
|
||||
-d : request disposition notification
|
||||
-r : request return receipt
|
||||
-charset <cs> : user defined charset. The default is iso-8859-1
|
||||
-a1 <header> : add custom header line at the end of the regular headers
|
||||
-a2 <header> : same as -a1, for a second custom header line
|
||||
-dsn <nsfd> : use Delivery Status Notifications (RFC 3461)
|
||||
n = never, s = successful, f = failure, d = delayed
|
||||
can be used together, however N takes precedence
|
||||
-hdrencb : use base64 for encoding headers, if necessary
|
||||
-hdrencq : use quoted-printable for encoding headers, if necessary
|
||||
-priority <pr> : set message priority 0 for low, 1 for high
|
||||
-sensitivity <s>: set message sensitivity 0 for personal, 1 for private,
|
||||
2 for company-confidential
|
||||
|
||||
----------------------- Attachment and encoding options -----------------------
|
||||
-attach <file> : attach binary file(s) to message (filenames comma separated)
|
||||
-attacht <file> : attach text file(s) to message (filenames comma separated)
|
||||
-attachi <file> : attach text file(s) as INLINE (filenames comma separated)
|
||||
-embed <file> : embed file(s) in HTML. Object tag in HTML must specify
|
||||
content-id using cid: tag. eg: <img src="cid:image.jpg">
|
||||
-af <file> : file containing list of binary file(s) to attach (comma
|
||||
separated)
|
||||
-atf <file> : file containing list of text file(s) to attach (comma
|
||||
separated)
|
||||
-aef <file> : file containing list of embed file(s) to attach (comma
|
||||
separated)
|
||||
-imaf : ignore missing attachment files. Do not stop for missing
|
||||
files.
|
||||
-base64 : send binary files using base64 (binary MIME)
|
||||
-uuencode : send binary files UUEncoded
|
||||
-enriched : send an enriched text message (Content-Type=text/enriched)
|
||||
-unicode : message body is in 16- or 32-bit Unicode format
|
||||
-html : send an HTML message (Content-Type=text/html)
|
||||
-alttext <text> : plain text for use as alternate text
|
||||
-alttextf <file>: plain text file for use as alternate text
|
||||
-mime : MIME Quoted-Printable Content-Transfer-Encoding
|
||||
-8bitmime : ask for 8bit data support when sending MIME
|
||||
-multipart <size>
|
||||
: send multipart messages, breaking attachments on <size>
|
||||
KB boundaries, where <size> is per 1000 bytes
|
||||
-nomps : do not allow multipart messages
|
||||
-contentType <string>
|
||||
: use <string> in the ContentType header for attachments that
|
||||
do not have a registered content type for the extension
|
||||
For example: -contenttype "text/calendar"
|
||||
|
||||
---------------------------- NNTP specific options ----------------------------
|
||||
-groups <usenet groups>
|
||||
: list of newsgroups (comma separated)
|
||||
|
||||
-------------------------------- Other options --------------------------------
|
||||
-xtndxmit : Attempt to use POP3 to transmit when accessing POP3 first
|
||||
-h : displays this help (also -?, /?, -help or /help)
|
||||
-q : suppresses all output to the screen
|
||||
-debug : echoes server communications to a log file or screen
|
||||
(overrides -q if echoes to the screen)
|
||||
-log <file> : log everything but usage to <file>
|
||||
-timestamp : when -log is used, a timestamp is added to each log line
|
||||
-overwritelog : when -log is used, overwrite the log file
|
||||
-logcmds : when -log is used, write command line options to log file
|
||||
-ti <n> : set timeout to 'n' seconds. Blat will wait 'n' seconds for
|
||||
server responses
|
||||
-try <n times> : how many times blat should try to send (1 to 'INFINITE')
|
||||
The default is 1.)
|
||||
-binary : do not convert ASCII | (pipe, 0x7c) to CrLf in the message
|
||||
body
|
||||
-hostname <hst> : select the hostname used to send the message via SMTP
|
||||
this is typically your local machine name
|
||||
-raw : do not add CR/LF after headers
|
||||
-delay <x> : wait x seconds between messages being sent when used with
|
||||
-maxnames or -multipart
|
||||
-comment <char> : use this character to mark the start of comments in
|
||||
options files and recipient list files. The default is ;
|
||||
-superdebug : hex/ascii dump the data between Blat and the server
|
||||
-superdebugT : ascii dump the data between Blat and the server
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
|
||||
and 'Sender:' fields in the header of the message.
|
||||
|
||||
Optionally, the following options can be used instead of the -f and -i
|
||||
options:
|
||||
|
||||
-mailfrom <addr> The RFC 821 MAIL From: statement
|
||||
-from <addr> The RFC 822 From: statement
|
||||
-replyto <addr> The RFC 822 Reply-To: statement
|
||||
-returnpath <addr> The RFC 822 Return-Path: statement
|
||||
-sender <addr> The RFC 822 Sender: statement
|
||||
|
||||
For backward consistency, the -f and -i options have precedence over these
|
||||
RFC 822 defined options. If both -f and -i options are omitted then the
|
||||
RFC 821 MAIL FROM statement will be defaulted to use the installation-defined
|
||||
default sender address.
|
||||
34
USMT-Gui-Replace-Scenario/Tools/blatdll.h
Normal file
34
USMT-Gui-Replace-Scenario/Tools/blatdll.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#if !defined(__BLATDLL_H__)
|
||||
#define __BLATDLL_H__
|
||||
|
||||
#include <tchar.h>
|
||||
|
||||
#if defined(_UNICODE) || defined(UNICODE)
|
||||
# define lcszBlatFunctionName_Send "SendW"
|
||||
# define lcszBlatFunctionName_Blat "BlatW"
|
||||
# define lcszBlatFunctionName_cSend "cSendW"
|
||||
# define lcszBlatFunctionName_SetPrintFunc "SetPrintFuncW"
|
||||
#else
|
||||
# define lcszBlatFunctionName_Send "SendA"
|
||||
# define lcszBlatFunctionName_Blat "BlatA"
|
||||
# define lcszBlatFunctionName_cSend "cSendA"
|
||||
# define lcszBlatFunctionName_SetPrintFunc "SetPrintFuncA"
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern __declspec(dllexport) int APIENTRY Send( LPCTSTR sCmd );
|
||||
|
||||
extern __declspec(dllexport) int _stdcall Blat( int argc, LPTSTR argv[] );
|
||||
|
||||
extern __declspec(dllexport) void _stdcall SetPrintFunc( void (__stdcall *func)(LPTSTR) );
|
||||
|
||||
extern __declspec(dllexport) int __cdecl cSend ( LPCTSTR sCmd );
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if !defined(__BLATDLL_H__) */
|
||||
1750
USMT-Gui-Replace-Scenario/Tools/cert.vbs
Normal file
1750
USMT-Gui-Replace-Scenario/Tools/cert.vbs
Normal file
File diff suppressed because it is too large
Load Diff
23
USMT-Gui-Replace-Scenario/Tools/commandeapres.bat
Normal file
23
USMT-Gui-Replace-Scenario/Tools/commandeapres.bat
Normal file
@@ -0,0 +1,23 @@
|
||||
net user Proservia1 /delete
|
||||
echo %1
|
||||
|
||||
cscript "%~dp0setAdministratorsMember.vbs" %1
|
||||
|
||||
ver | findstr /i "5\.1\." > nul
|
||||
IF %ERRORLEVEL% EQU 0 goto DetectWinXP
|
||||
Set Pathrob=robocopy
|
||||
goto Robobocopy
|
||||
|
||||
:DetectWinXP
|
||||
Set Pathrob="%~dp0robocopy.exe"
|
||||
goto Robobocopy
|
||||
|
||||
:Robobocopy
|
||||
set Patchback=%1
|
||||
set Patchback=%Patchback:~0,-1%
|
||||
echo %Patchback%
|
||||
|
||||
%Pathrob% %Patchback%\_C" c:\_C /e /R:0 /LOG:%Patchback%\Rob_AfterC.log"
|
||||
%Pathrob% %Patchback%\_D" c:\_D /e /R:0 /LOG:%Patchback%\Rob_AfterD.log"
|
||||
|
||||
|
||||
33
USMT-Gui-Replace-Scenario/Tools/commandeavant.bat
Normal file
33
USMT-Gui-Replace-Scenario/Tools/commandeavant.bat
Normal file
@@ -0,0 +1,33 @@
|
||||
echo %1
|
||||
::cscript "%~dp0GetLicenceAdobe.vbs" %1
|
||||
::cscript "%~dp0GetLicenceOffice.vbs" %1
|
||||
cscript "%~dp0ListPrinters.vbs" %1
|
||||
cscript "%~dp0getAdministratorsMember.vbs" %1
|
||||
|
||||
ver | findstr /i "5\.1\." > nul
|
||||
IF %ERRORLEVEL% EQU 0 goto DetectWinXP
|
||||
Set Pathrob=robocopy
|
||||
goto Robobocopy
|
||||
|
||||
:DetectWinXP
|
||||
Set Pathrob="%~dp0robocopy.exe"
|
||||
goto Robobocopy
|
||||
|
||||
|
||||
|
||||
:Robobocopy
|
||||
set Patchback=%1
|
||||
set Patchback=%Patchback:~0,-1%
|
||||
echo %Patchback%
|
||||
%Pathrob% c:\ %Patchback%\_C" /MIR /R:0 /XD c:\Windows /XD c:\temp /LOG:%Patchback%\Rob_BeforeC.log"
|
||||
|
||||
if "%~d0" == "D:" goto bypassd
|
||||
if "%~d0" == "d:" goto bypassd
|
||||
%Pathrob% d:\ %Patchback%\_D" /MIR /R:0 /LOG:%Patchback%\Rob_BeforeD.log"
|
||||
|
||||
:bypassd
|
||||
%pathrob% c:\windows %patchback%\_C\windows" *.ini /E /LOG:%Patchback%\Rob_BeforeINI.log"
|
||||
|
||||
attrib -h -s %Patchback%\_C"
|
||||
attrib -h -s %Patchback%\_D"
|
||||
dir %Patchback%"
|
||||
53
USMT-Gui-Replace-Scenario/Tools/getAdministratorsMember.vbs
Normal file
53
USMT-Gui-Replace-Scenario/Tools/getAdministratorsMember.vbs
Normal file
@@ -0,0 +1,53 @@
|
||||
Const HKEY_LOCAL_MACHINE = &H80000002
|
||||
|
||||
Dim args, Fso,Shell
|
||||
Set args = Wscript.Arguments
|
||||
Set Fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set Shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Dim FolderBackup, strOs, strArchi, FUsers, PartW, PatchNotes, VersionNotes, LogFile, Temp, UserBackup, ExitCode
|
||||
Dim robocopy, Extention
|
||||
ExitCode = 0
|
||||
' --------------------- Chemin fichier INI ------------------------------------
|
||||
PatchHTA = WScript.ScriptFullName
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\") -1)
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\"))
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
StrComputerName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
if args.count = 0 Then
|
||||
Msgbox "Error Args"
|
||||
Else
|
||||
FolderBackup = args(0)
|
||||
End If
|
||||
|
||||
LogFile = Left(FolderBackup,Len(FolderBackup) - (Len(FolderBackup) - InstrRev(FolderBackup,"\"))) & StrComputerName & "\AdministratorsMembers.txt"
|
||||
If Fso.FileExists(LogFile) Then CodeRetour = Fso.deleteFile(LogFile,True)
|
||||
|
||||
|
||||
Set colGroups = GetObject("WinNT://" & "." & "")
|
||||
colGroups.Filter = Array("group")
|
||||
For Each objGroup In colGroups
|
||||
For Each objUser in objGroup.Members
|
||||
If UCASE(objGroup.Name) = "ADMINISTRATEURS" Or UCASE(objGroup.Name) = "ADMINISTRATORS" Then
|
||||
TraceLog LogFile , objUser.Name
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
|
||||
Function GetPath()
|
||||
Dim path
|
||||
Deftpath = WScript.ScriptFullName
|
||||
GetPath = Left(Deftpath, InStrRev(Deftpath, "\"))
|
||||
End Function
|
||||
BIN
USMT-Gui-Replace-Scenario/Tools/robocopy.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/robocopy.exe
Normal file
Binary file not shown.
66
USMT-Gui-Replace-Scenario/Tools/setAdministratorsMember.vbs
Normal file
66
USMT-Gui-Replace-Scenario/Tools/setAdministratorsMember.vbs
Normal file
@@ -0,0 +1,66 @@
|
||||
Const HKEY_LOCAL_MACHINE = &H80000002
|
||||
|
||||
Dim args, Fso,Shell
|
||||
Set args = Wscript.Arguments
|
||||
Set Fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set Shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Dim FolderBackup, strOs, strArchi, FUsers, PartW, PatchNotes, VersionNotes, LogFile, Temp, UserBackup, ExitCode
|
||||
Dim robocopy, Extention
|
||||
ExitCode = 0
|
||||
' --------------------- Chemin fichier INI ------------------------------------
|
||||
PatchHTA = WScript.ScriptFullName
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\") -1)
|
||||
PatchHTA = Left(PatchHTA, InStrRev(PatchHTA, "\"))
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
StrComputerName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
|
||||
|
||||
' --------------------- Dossier de sauvegarde ---------------------------------
|
||||
if args.count = 0 Then
|
||||
Msgbox "Error Args"
|
||||
Else
|
||||
FolderBackup = args(0)
|
||||
End If
|
||||
|
||||
LogFile = Left(FolderBackup,Len(FolderBackup) - (Len(FolderBackup) - InstrRev(FolderBackup,"\"))) & Right(FolderBackup,Len(FolderBackup)-InstrRev(FolderBackup,"\")) & "\SetAdministratorsMembers.log"
|
||||
If Fso.FileExists(LogFile) Then CodeRetour = Fso.deleteFile(LogFile,True)
|
||||
TraceLog LogFile , "#############################################################################"
|
||||
|
||||
FileAdmin = Left(FolderBackup,Len(FolderBackup) - (Len(FolderBackup) - InstrRev(FolderBackup,"\"))) & Right(FolderBackup,Len(FolderBackup)-InstrRev(FolderBackup,"\")) & "\AdministratorsMembers.txt"
|
||||
If Fso.FileExists(FileAdmin) Then
|
||||
|
||||
set inf= Fso.OpenTextFile(FileAdmin)
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
Command1 = "net localgroup " & chr(34) & "Administrateurs" & chr(34) & " " & Ligne & " /add"
|
||||
Command2 = "net localgroup " & chr(34) & "Administrators" & chr(34) & " " & Ligne & " /add"
|
||||
TraceLog LogFile , Command1
|
||||
CodeRetour = Shell.run("cmd /c " & Command1,0,True)
|
||||
TraceLog LogFile , "Exit : " & CodeRetour
|
||||
|
||||
TraceLog LogFile , Command2
|
||||
CodeRetour = Shell.run("cmd /c " & Command2,0,True)
|
||||
TraceLog LogFile , "Exit : " & CodeRetour
|
||||
|
||||
TraceLog LogFile , " "
|
||||
Wend
|
||||
|
||||
Else
|
||||
TraceLog LogFile , "ERROR " & FileAdmin & " not exist"
|
||||
End If
|
||||
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline cstr(Date) & " " & cstr(Time) & " | " & Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
|
||||
Function GetPath()
|
||||
Dim path
|
||||
Deftpath = WScript.ScriptFullName
|
||||
GetPath = Left(Deftpath, InStrRev(Deftpath, "\"))
|
||||
End Function
|
||||
BIN
USMT-Gui-Replace-Scenario/Tools/sqldiff.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/sqldiff.exe
Normal file
Binary file not shown.
BIN
USMT-Gui-Replace-Scenario/Tools/sqlite3.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/sqlite3.exe
Normal file
Binary file not shown.
BIN
USMT-Gui-Replace-Scenario/Tools/sqlite3_analyzer.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/sqlite3_analyzer.exe
Normal file
Binary file not shown.
BIN
USMT-Gui-Replace-Scenario/Tools/trace32.exe
Normal file
BIN
USMT-Gui-Replace-Scenario/Tools/trace32.exe
Normal file
Binary file not shown.
36
USMT-Gui-Replace-Scenario/USMTStart.ini
Normal file
36
USMT-Gui-Replace-Scenario/USMTStart.ini
Normal file
@@ -0,0 +1,36 @@
|
||||
[Transfert]
|
||||
; c:\users est remplac<61> par c:\document and setting ou c:\users en fonction de l'OS
|
||||
; possibilit<69> de copier uniquement les extensions avec *.ext
|
||||
c:\Users\%username%\Downloads
|
||||
;c:\Users\%username%\Pictures
|
||||
;c:\Users\%username%\Desktop\travail\*.key
|
||||
c:\Users\%username%\Desktop\*.lnk
|
||||
c:\Users\%username%\Desktop\*.rdp
|
||||
c:\Users\%username%\Favorites
|
||||
;c:\Users\%username%\SSOX
|
||||
;c:\Users\%username%\Videos
|
||||
;c:\Users\%username%\AppData\Local\Notes
|
||||
;c:\Users\%username%\AppData\Roaming\Notes
|
||||
;c:\Users\%username%\Appdata\LocalLow\notes
|
||||
;c:\Users\%username%\Documents
|
||||
;C:\Program Files\openvpn\*.ovpn
|
||||
c:\Users\%username%\Local Settings\Application Data\Google==c:\Users\%username%\AppData\Local\Google
|
||||
;c:\Users\%username%\AppData\Local\Google
|
||||
d:\Documents and Settings\All Users\Bureau==c:\Users\Public\Desktop
|
||||
c:\Documents and Settings\All Users\Bureau==c:\Users\Public\Desktop
|
||||
d:\Documents and Settings\All Users\Desktop==c:\Users\Public\Desktop
|
||||
c:\Documents and Settings\All Users\Desktop==c:\Users\Public\Desktop
|
||||
c:\Users\Public\Desktop
|
||||
;c:\windows\temp
|
||||
;c:\temp
|
||||
|
||||
[ExcludeUsers]
|
||||
import_ad
|
||||
Proservia1
|
||||
|
||||
[Password]
|
||||
SetPassword=Yes
|
||||
NewPassword=Superu@2016
|
||||
ExcludeUser=adm-bkpnetwork,administrateur,administrator,cba_anonymous,invit<69>,guest
|
||||
|
||||
|
||||
663
USMT-Gui-Replace-Scenario/USMTStartV4.3.hta
Normal file
663
USMT-Gui-Replace-Scenario/USMTStartV4.3.hta
Normal file
@@ -0,0 +1,663 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
|
||||
|
||||
<title>USMT Start</title>
|
||||
<hta:application id="USMT" scroll="No" border="thin" borderstyle="normal" caption="yes" icon="Images\icone.ico" maximizebutton="no" minimizebutton="yes" showintaskbar="yes" singleinstance="no" sysmenu="yes" version="1.0" windowstate="NORMAL"></hta:application>
|
||||
<script language="VBScript">
|
||||
|
||||
Const HKEY_LOCAL_MACHINE = &H80000002
|
||||
Set Fso = CreateObject("Scripting.FileSystemObject")
|
||||
Set Shell = CreateObject("Wscript.Shell")
|
||||
|
||||
Dim PathUSMTx86
|
||||
Dim PathUSMTx64
|
||||
Dim Trace32 : Trace32 = "\Tools\trace32.exe"
|
||||
Dim MigView : MigView = "\Tools\MigViewer.exe"
|
||||
|
||||
Dim CBackup : CBackup = "\Tools\CustomBackup.vbs"
|
||||
Dim CRestore : CRestore = "\Tools\CustomRestore.vbs"
|
||||
|
||||
Dim EDrives : EDrives = "\Tools\USMTExcludeDrives.vbs"
|
||||
Dim EDrivesXML : EDrivesXML = "\Tools\USMTExcludeDrives.xml"
|
||||
|
||||
Dim PathOld
|
||||
Dim Trace32i, MigViewi, CBackupi, CRestorei
|
||||
Dim PathScanstate, PathLoadstate
|
||||
Dim ComputerBackup, StrComputerName
|
||||
Dim TabUSMT
|
||||
Redim TabUSMT(0)
|
||||
Dim PathUSMT
|
||||
Dim VersionOS
|
||||
Dim Argument
|
||||
|
||||
Dim TabUSR
|
||||
Redim TabUSR(0)
|
||||
|
||||
Dim PatchUSMTSTART
|
||||
|
||||
' Variable
|
||||
Dim letter
|
||||
letter = array("c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
|
||||
|
||||
|
||||
Sub Window_Onload
|
||||
Argument = USMT.commandLine
|
||||
Argument = replace(UCase(Argument),chr(34),"")
|
||||
TempArg = split(UCase(Argument),".HTA")
|
||||
Argument = Trim(TempArg(1))
|
||||
|
||||
On error resume Next
|
||||
window.resizeTo 450,440
|
||||
USMT_Current.innerHTML = ""
|
||||
USMT_Result.innerHTML = ""
|
||||
Custom_Result.innerHTML = ""
|
||||
Bouton_Log1.innerHTML = ""
|
||||
Bouton_Log2.innerHTML = ""
|
||||
Bouton_view.innerHTML = ""
|
||||
Bouton_Diff.innerHTML = ""
|
||||
|
||||
strHtmlLocnVal = document.location.href
|
||||
|
||||
'file://serv/MDT/_Outil/USMT/USMTSTARTV3.0.hta
|
||||
strThisHTA = Replace(strHtmlLocnVal,"/", "\")
|
||||
strThisHTA = Right(strThisHTA,Len(strThisHTA)-5)
|
||||
strThisHTA = Replace(strThisHTA,"\\\", "")
|
||||
|
||||
strThisHTA = UnEscape(strThisHTA)
|
||||
Set objThisFile = Fso.GetFile(strThisHTA)
|
||||
objParentDir = objThisFile.ParentFolder
|
||||
Set objFolder = Fso.GetFolder(objParentDir)
|
||||
objCurrDir = objFolder.Path
|
||||
|
||||
PatchUSMTSTART = objCurrDir
|
||||
if Right(PatchUSMTSTART,1) = "\" Then
|
||||
PatchUSMTSTART = Left(PatchUSMTSTART,(Len(PatchUSMTSTART) -1))
|
||||
End If
|
||||
|
||||
StrComputerName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
|
||||
PathUSMT = PatchUSMTSTART & "\USMT"
|
||||
PathOld = PatchUSMTSTART & "\USMT"
|
||||
Trace32i = PatchUSMTSTART & Trace32
|
||||
MigViewi = PatchUSMTSTART & MigView
|
||||
|
||||
CBackupi = PatchUSMTSTART & CBackup
|
||||
CRestorei = PatchUSMTSTART & CRestore
|
||||
EDrives = PatchUSMTSTART & EDrives
|
||||
EDrivesXML = PatchUSMTSTART & EDrivesXML
|
||||
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "##############################################################################"
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "PathUSMT=" & PathUSMT
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "PathOld=" & PathOld
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Trace32i=" & Trace32i
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "MigViewi=" & MigViewi
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "CBackupi=" & CBackupi
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "CRestorei=" & CRestorei
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "EDrives=" & EDrives
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "EDrivesXML=" & EDrivesXML
|
||||
|
||||
|
||||
'detection de la version d'OS pour determiner la version d'USMT à utiliser
|
||||
on error resume next
|
||||
VersionOS = "0"
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2")
|
||||
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
|
||||
For Each objOperatingSystem in colOperatingSystems
|
||||
VersionOS = objOperatingSystem.Version
|
||||
Next
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "VersionOS=" & VersionOS
|
||||
|
||||
PathUSMTx86 = "\Tools\USMT562\x86"
|
||||
PathUSMTx64 = "\Tools\USMT562\amd64"
|
||||
on error goto 0
|
||||
if instr(VersionOS,"10.0") Then
|
||||
PathUSMTx86 = "\Tools\USMT10\x86"
|
||||
PathUSMTx64 = "\Tools\USMT10\amd64"
|
||||
End If
|
||||
if instr(VersionOS,"6.3") Then
|
||||
PathUSMTx86 = "\Tools\USMT563\x86"
|
||||
PathUSMTx64 = "\Tools\USMT563\amd64"
|
||||
End If
|
||||
|
||||
|
||||
'PDT10X6401 | VersionOS=10.0.10586
|
||||
'PDT81X6401 | VersionOS=6.3.9600
|
||||
'PDTX6401 | VersionOS=6.1.7601
|
||||
'PDTXP01 | VersionOS=5.1.2600
|
||||
'PDT80X6401 | VersionOS=6.2.9200
|
||||
'pdtvistax6401 | VersionOS=6.0.6002
|
||||
|
||||
|
||||
If Fso.FolderExists("C:\Windows\SysWOW64") Then
|
||||
PathScanstate = PatchUSMTSTART & PathUSMTx64
|
||||
PathLoadstate = PatchUSMTSTART & PathUSMTx64
|
||||
Else
|
||||
PathScanstate = PatchUSMTSTART & PathUSMTx86
|
||||
PathLoadstate = PatchUSMTSTART & PathUSMTx86
|
||||
End If
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "PathScanstate=" & PathScanstate
|
||||
|
||||
|
||||
ComputerBackup = ""
|
||||
If Fso.FileExists(PathUSMT & "\flag.txt") Then
|
||||
Set inf = Fso.OpenTextFile(PathUSMT & "\flag.txt", 1)
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
ComputerBackup = Ligne
|
||||
Wend
|
||||
inf.Close
|
||||
End If
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Check : " & PathUSMT & "\flag.txt"
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "ComputerBackup=" & ComputerBackup
|
||||
|
||||
|
||||
If Fso.FileExists(PathUSMT & "\flag.txt") Then
|
||||
Set inf = Fso.OpenTextFile(PathUSMT & "\flag.txt", 1)
|
||||
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
|
||||
Wend
|
||||
inf.Close
|
||||
Else
|
||||
Bouton_view.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "MigViewer" & chr(34) & " name=" & chr(34) & "MigViewer" & chr(34) & " onclick=" & chr(34) & "Lance_Tools" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
End If
|
||||
|
||||
|
||||
'New
|
||||
Redim TabUSMT(0)
|
||||
set objFolder = Fso.GetFolder(PathUSMT & "\")
|
||||
for Each folder in objFolder.SubFolders
|
||||
TabUSMT(Ubound(TabUSMT)) = folder.name
|
||||
Redim Preserve TabUSMT(Ubound(TabUSMT)+1)
|
||||
Next
|
||||
|
||||
|
||||
HtmlCode = "<select size=" & chr(34) & "1" & chr(34) & " name=" & chr(34) & "DropDown1" & chr(34) & " onChange=" & chr(34) & "ChangeVariable" & chr(34) & ">"
|
||||
|
||||
For i = 0 To (Ubound(TabUSMT) -1)
|
||||
HtmlCode = HtmlCode & "<option value=" & chr(34) & (i+1) & chr(34) & ">" & TabUSMT(i) & "</option>"
|
||||
Next
|
||||
|
||||
HtmlCode = HtmlCode & "</select>"
|
||||
USMT_Current.innerHTML = HtmlCode
|
||||
|
||||
For i = 0 To (Ubound(TabUSMT) -1)
|
||||
If UCase(TabUSMT(i)) = UCase(ComputerBackup) Then
|
||||
DropDown1.Value = (i+1)
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
ListUSER
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "##############################################################################"
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & " "
|
||||
|
||||
' Si argument lancement auto
|
||||
If Instr(Argument,"BACKUP") <> 0 Then
|
||||
Call Lance_Scanstate
|
||||
End If
|
||||
|
||||
If Instr(Argument,"RESTORE") <> 0 Then
|
||||
Call Lance_Loadstate
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ChangeVariable
|
||||
ComputerBackup = TabUSMT(DropDown1.Value -1)
|
||||
End Sub
|
||||
|
||||
Sub ListUSER
|
||||
HtmlCode = "<select size=" & chr(34) & "3" & chr(34) & " name=" & chr(34) & "DropDown2" & chr(34) & " multiple>"
|
||||
|
||||
Set objRegistry=GetObject("winmgmts:\\" & "." & "\root\default:StdRegProv")
|
||||
|
||||
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
|
||||
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
|
||||
|
||||
i = 0
|
||||
|
||||
For Each objSubkey In arrSubkeys
|
||||
strValueName = "ProfileImagePath"
|
||||
strSubPath = strKeyPath & "\" & objSubkey
|
||||
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,strValue
|
||||
strValue = Right(strValue, Len(strValue) - InstrRev(strValue,"\"))
|
||||
If UCase(strValue) <> "LOCALSERVICE" And UCase(strValue) <> "NETWORKSERVICE" And UCase(strValue) <> "SYSTEMPROFILE" Then
|
||||
iniexclusion = 0
|
||||
|
||||
set inf= Fso.OpenTextFile(PatchUSMTSTART & "\USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
If Left(Ligne,1) <> ";" Then
|
||||
If LectureTransfert = 1 Then
|
||||
Ligne = UCase(Ligne)
|
||||
if UCase(strValue) = UCase(Ligne) Then iniexclusion = 1
|
||||
End If
|
||||
End If
|
||||
if Instr(UCase(Ligne),"[") <> 0 And Instr(UCase(Ligne),"]") <> 0 Then LectureTransfert = 0
|
||||
If Instr(UCase(Ligne),"[EXCLUDEUSERS]") <> 0 Then LectureTransfert = 1
|
||||
Wend
|
||||
inf.close
|
||||
|
||||
If iniexclusion = 0 Then
|
||||
|
||||
If Instr(strValue,".") <> 0 Then
|
||||
Temp = split(strValue,".")
|
||||
strValue = Temp(0)
|
||||
End If
|
||||
|
||||
ContinueUSB = 1
|
||||
For j = O To UBound(TabUSR)
|
||||
If UCase(strValue) = UCase(TabUSR(j)) Then ContinueUSB = 0
|
||||
Next
|
||||
|
||||
|
||||
If ContinueUSB = 1 Then
|
||||
i = i + 1
|
||||
TabUSR(Ubound(TabUSR)) = strValue
|
||||
Redim Preserve TabUSR(Ubound(TabUSR)+1)
|
||||
HtmlCode = HtmlCode & "<option value=" & chr(34) & i & chr(34) & ">" & strValue & "</option>"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
HtmlCode = HtmlCode & "</select>"
|
||||
|
||||
ListUsr.innerHTML = HtmlCode
|
||||
End Sub
|
||||
|
||||
Sub Lance_Scanstate
|
||||
Set inf = Fso.CreateTextFile(PathUSMT & "\flag.txt", True)
|
||||
CodeExit = 0
|
||||
CodeRetour = Inf.WriteLine(StrComputerName)
|
||||
Inf.close
|
||||
|
||||
' generation du fichier xml d'exclusion des HDD USB
|
||||
If Fso.fileExists(EDrivesXML) Then CodeRetour = Fso.deletefile(EDrivesXML, True)
|
||||
If Fso.FileExists(EDrives) then
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Start=" & chr(34) & EDrives & chr(34)
|
||||
CodeExe = Shell.run("cmd /c cscript " & chr(34) & EDrives & chr(34),,True)
|
||||
End If
|
||||
|
||||
If Fso.FileExists(PatchUSMTSTART & "\tools\commandeavant.bat") then
|
||||
If Fso.FolderExists(PathUSMT & "\" & StrComputerName) = False Then CodeRetour = Fso.createFolder(PathUSMT & "\" & StrComputerName)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Start=" & chr(34) & PatchUSMTSTART & "\tools\commandeavant.bat" & chr(34) & " " & chr(34) & PathUSMT & "\" & StrComputerName & chr(34)
|
||||
CodeExe = Shell.run(chr(34) & PatchUSMTSTART & "\tools\commandeavant.bat" & chr(34) & " " & chr(34) & PathUSMT & "\" & StrComputerName & chr(34),,True)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "exitcode=" & codeexe
|
||||
|
||||
If CodeExe = 0 Then
|
||||
Custom_commande.innerHTML = "End Commande = " & CodeExe
|
||||
Else
|
||||
Custom_commande.innerHTML = "<span style=" & chr(34) & "font-weight: bold; color: rgb(255, 0, 0);" & chr(34) & ">" & "End Commande = " & CodeExe & "</span>"
|
||||
End If
|
||||
|
||||
|
||||
CodeExit = CodeExit + CodeExe
|
||||
Else
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "not exist=" & chr(34) & PatchUSMTSTART & "\tools\commandeavant.bat" & chr(34)
|
||||
End If
|
||||
|
||||
ExcludeUSR = ""
|
||||
IncludeUSR = ""
|
||||
For i = 0 to (Ubound(TabUSR) -1)
|
||||
ExcludeUSR = ExcludeUSR & " /ue:" & TabUSR(i)
|
||||
Next
|
||||
|
||||
iniexclusion = 0
|
||||
set inf= Fso.OpenTextFile(PatchUSMTSTART & "\USMTStart.ini")
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
If Left(Ligne,1) <> ";" And ligne <> "" And Left(Ligne,1) <> "["Then
|
||||
If LectureTransfert = 1 Then
|
||||
ExcludeUSR = ExcludeUSR & " /ue:" & Ligne
|
||||
End If
|
||||
End If
|
||||
if Instr(UCase(Ligne),"[") <> 0 And Instr(UCase(Ligne),"]") <> 0 Then LectureTransfert = 0
|
||||
If Instr(UCase(Ligne),"[EXCLUDEUSERS]") <> 0 Then LectureTransfert = 1
|
||||
Wend
|
||||
inf.close
|
||||
|
||||
if ExcludeUSR = "" Then ExcludeUSR = " "
|
||||
|
||||
For i = 0 to (Dropdown2.Options.Length - 1)
|
||||
If (Dropdown2.Options(i).Selected) Or Instr(Argument,"BACKUP") <> 0 Then
|
||||
ExcludeUSR = Replace(ExcludeUSR," /ue:" & TabUSR(Dropdown2.Options(i).Value -1),"")
|
||||
IncludeUSR = IncludeUSR & TabUSR(Dropdown2.Options(i).Value -1) & ","
|
||||
End If
|
||||
Next
|
||||
|
||||
Lanseur = Chr(34) & PathScanstate & "\scanstate.exe" & chr(34)
|
||||
Comande = chr(34) & PathUSMT & "\" & StrComputerName & chr(34) & " /v:13 /c /o" & ExcludeUSR & " /localonly"
|
||||
XMLfile = "/i:" & chr(34) & PathScanstate & "\MigApp.xml" & chr(34) & " /i:" & chr(34) & PathScanstate & "\Miguser.xml" & chr(34)
|
||||
|
||||
XMLconfig = " "
|
||||
|
||||
If Fso.FileExists(PathScanstate & "\config.xml") Then
|
||||
XMLconfig1 = " /config:" & chr(34) & PathScanstate & "\config.xml" & chr(34)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Exist=" & PathScanstate & "\config.xml"
|
||||
Else
|
||||
XMLconfig1 = " "
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Not Exist=" & PathScanstate & "\config.xml"
|
||||
End If
|
||||
|
||||
If Fso.FileExists(EDrivesXML) Then
|
||||
XMLconfig2 = " /i:" & chr(34) & EDrivesXML & chr(34)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Exist=" & EDrivesXML
|
||||
Else
|
||||
XMLconfig2 = " "
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Not Exist=" & EDrivesXML
|
||||
End If
|
||||
|
||||
If XMLconfig1 = " " And XMLconfig2 = " " Then
|
||||
XMLconfig = " "
|
||||
End If
|
||||
|
||||
If XMLconfig1 <> " " And XMLconfig2 = " " Then
|
||||
XMLconfig = XMLconfig1 & " "
|
||||
End If
|
||||
|
||||
If XMLconfig1 = " " And XMLconfig2 <> " " Then
|
||||
XMLconfig = XMLconfig2 & " "
|
||||
End If
|
||||
|
||||
If XMLconfig1 <> " " And XMLconfig2 <> " " Then
|
||||
XMLconfig = XMLconfig1 & XMLconfig2 & " "
|
||||
End If
|
||||
|
||||
|
||||
LogFile = "/l:" & chr(34) & PathOld & "\" & StrComputerName & "\USMTBackup.log" & chr(34)
|
||||
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & Lanseur & " " & Comande & " " & XMLfile & XMLconfig & LogFile
|
||||
CodeExe = Shell.Run(Lanseur & " " & Comande & " " & XMLfile & XMLconfig & LogFile,,True)
|
||||
if CodeExe = 0 Then
|
||||
USMT_Result.innerHTML = "End USMT = " & CodeExe
|
||||
Else
|
||||
USMT_Result.innerHTML = "<span style=" & chr(34) & "font-weight: bold; color: rgb(255, 0, 0);" & chr(34) & ">" & "End USMT = " & CodeExe & "</span>"
|
||||
End If
|
||||
|
||||
|
||||
CodeExit = CodeExit + CodeExe
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "End USMT = " & CodeExe
|
||||
|
||||
Bouton_Log1.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "Log USMT" & chr(34) & " name=" & chr(34) & "Log" & chr(34) & " onclick=" & chr(34) & "Lance_logscanstate" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
|
||||
if Fso.FileExists(CBackupi) Then
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "cmd /c cscript " & chr(34) & CBackupi & chr(34) & " " & chr(34) & PathUSMT & "\" & StrComputerName & chr(34) & " " & IncludeUSR
|
||||
CodeExe = Shell.run("cmd /c cscript " & chr(34) & CBackupi & chr(34) & " " & chr(34) & PathUSMT & "\" & StrComputerName & chr(34) & " " & IncludeUSR,,True)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "End Custom = " & CodeExe
|
||||
|
||||
If codeExe = 0 Then
|
||||
Custom_Result.innerHTML = "End Custom = " & Cstr(CodeExe)
|
||||
Else
|
||||
Custom_Result.innerHTML = "<span style=" & chr(34) & "font-weight: bold; color: rgb(255, 0, 0);" & chr(34) & ">" & "End Custom = " & CodeExe & "</span>"
|
||||
End If
|
||||
|
||||
|
||||
CodeExit = CodeExit + CodeExe
|
||||
Bouton_Log2.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "Log Custom" & chr(34) & " name=" & chr(34) & "Log" & chr(34) & " onclick=" & chr(34) & "Lance_logsCustomBackup" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
End If
|
||||
|
||||
|
||||
Bouton_view.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "MigViewer" & chr(34) & " name=" & chr(34) & "MigViewer" & chr(34) & " onclick=" & chr(34) & "Lance_Tools" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
Bouton_Diff.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "View Filename" & chr(34) & " name=" & chr(34) & "View Filename" & chr(34) & " onclick=" & chr(34) & "Lance_Diff" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
|
||||
If Instr(Argument,"BACKUP") <> 0 Then self.close(CodeExit)
|
||||
End Sub
|
||||
|
||||
sub Lance_Tools
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & MigViewi
|
||||
CodeExe = Shell.Run(chr(34) & MigViewi & chr(34),,False)
|
||||
end sub
|
||||
|
||||
Sub Lance_logscanstate
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & StrComputerName & "\USMTBackup.log" & chr(34)
|
||||
CodeExe = Shell.Run(chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & StrComputerName & "\USMTBackup.log" & chr(34),,False)
|
||||
end sub
|
||||
|
||||
Sub Lance_logloadstate
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & ComputerBackup & "\USMTRestore.log" & chr(34)
|
||||
CodeExe = Shell.Run(chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & ComputerBackup & "\USMTRestore.log" & chr(34),,False)
|
||||
end sub
|
||||
|
||||
|
||||
Sub Lance_logsCustomBackup
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & StrComputerName & "\CustomBackup.log" & chr(34)
|
||||
CodeExe = Shell.Run(chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & StrComputerName & "\CustomBackup.log" & chr(34),,False)
|
||||
end sub
|
||||
|
||||
Sub Lance_logsCustomRestore
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & ComputerBackup & "\CustomRestore.log" & chr(34)
|
||||
CodeExe = Shell.Run(chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & ComputerBackup & "\CustomRestore.log" & chr(34),,False)
|
||||
end sub
|
||||
|
||||
Sub Lance_Diff
|
||||
Dossierm1 = ""
|
||||
Compteur = 0
|
||||
|
||||
If Fso.FileExists(PathOld & "\" & StrComputerName & "\USMTBackup.log") Then
|
||||
set inf= Fso.OpenTextFile(PathOld & "\" & StrComputerName & "\USMTBackup.log")
|
||||
Set inf2 = FSO.createTextFile(PathOld & "\" & StrComputerName & "\Diff.log")
|
||||
inf2.writeline "Dossier avec probleme..."
|
||||
While inf.AtEndOfStream <> True
|
||||
Ligne = Trim(Inf.Readline)
|
||||
If Instr(Ucase(Ligne),"PROCESSING FILE") <> 0 Then
|
||||
Temp = Split(UCase(Ligne),"PROCESSING FILE")
|
||||
|
||||
If Right(Ligne,1) = "]" Then
|
||||
Temp2 = Split(Temp(1),"[")
|
||||
Temp2(0) = Trim(Temp2(0))
|
||||
Temp2(1) = Trim(Temp2(1))
|
||||
|
||||
Compteur = Compteur + 1
|
||||
Dossierm1 = Temp2(0)
|
||||
|
||||
Else
|
||||
If Dossierm1 <> "" Then
|
||||
On error resume next
|
||||
Set DataFolder = Fso.GetFolder(Dossierm1)
|
||||
If err.number = 0 Then
|
||||
Set DataFiles = DataFolder.Files
|
||||
NumberOfFiles = DataFiles.Count
|
||||
If Compteur <> NumberOfFiles Then
|
||||
inf2.writeline Dossierm1 & "==>" & Compteur & "=" & NumberOfFiles
|
||||
End If
|
||||
Else
|
||||
inf2.writeline Dossierm1 & "==>" & Compteur & "=" & "ERROR"
|
||||
End If
|
||||
Compteur = 0
|
||||
On error goto 0
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Wend
|
||||
inf.close
|
||||
Inf2.close
|
||||
CodeExe = Shell.Run(chr(34) & Trace32i & chr(34) & " " & chr(34) & PathOld & "\" & StrComputerName & "\Diff.log" & chr(34),,False)
|
||||
Else
|
||||
Msgbox "not exist " & PathOld & "\" & StrComputerName & "\USMTBackup.log"
|
||||
End If
|
||||
|
||||
'ListUsr.innerHTML = ""
|
||||
End Sub
|
||||
|
||||
Sub Lance_Loadstate
|
||||
If Instr(UCase(Argument),"COMPUTER=") <> 0 Then
|
||||
Temp = Split(UCase(Argument),"COMPUTER=")
|
||||
ComputerBackup = Temp(1)
|
||||
Else
|
||||
ComputerBackup = TabUSMT(DropDown1.Value -1)
|
||||
End If
|
||||
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "ComputerBackup=" & ComputerBackup
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & ">>>> " & ComputerBackup & " TO " & StrComputerName & " <<<<"
|
||||
If ComputerBackup = "" Then
|
||||
Msgbox "Auto Detect Old Computername Error"
|
||||
|
||||
Else
|
||||
CodeExit = 0
|
||||
|
||||
Lanseur = Chr(34) & PathLoadstate & "\loadstate.exe" & chr(34)
|
||||
Comande = chr(34) & PathUSMT & "\" & ComputerBackup & chr(34) & " /v:13 /c /lac"
|
||||
XMLfile = "/i:" & chr(34) & PathLoadstate & "\MigApp.xml" & chr(34) & " /i:" & chr(34) & PathLoadstate & "\Miguser.xml" & chr(34)
|
||||
LogFile = "/l:" & chr(34) & PathOld & "\" & ComputerBackup & "\USMTRestore.log" & chr(34)
|
||||
|
||||
If Fso.FileExists(PathScanstate & "\config.xml") Then
|
||||
XMLconfig = " /config:" & chr(34) & PathScanstate & "\config.xml" & chr(34) & " "
|
||||
Else
|
||||
XMLconfig = " "
|
||||
End If
|
||||
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & Lanseur & " " & Comande & " " & XMLfile & XMLconfig & " " & LogFile
|
||||
CodeExe = Shell.Run(Lanseur & " " & Comande & " " & XMLfile & XMLconfig & LogFile,,True)
|
||||
|
||||
if CodeExe = 0 Then
|
||||
USMT_Result.innerHTML = "End USMT = " & CodeExe
|
||||
Else
|
||||
USMT_Result.innerHTML = "<span style=" & chr(34) & "font-weight: bold; color: rgb(255, 0, 0);" & chr(34) & ">" & "End USMT = " & CodeExe & "</span>"
|
||||
End If
|
||||
|
||||
CodeExit = CodeExit + CodeExe
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "End USMT = " & CodeExe
|
||||
Bouton_Log1.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "Log USMT" & chr(34) & " name=" & chr(34) & "Log" & chr(34) & " onclick=" & chr(34) & "Lance_logloadstate" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
Bouton_view.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "MigViewer" & chr(34) & " name=" & chr(34) & "MigViewer" & chr(34) & " onclick=" & chr(34) & "Lance_Tools" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
Bouton_Diff.innerHTML = ""
|
||||
|
||||
if Fso.FileExists(CRestorei) Then
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "cmd /c cscript " & chr(34) & CRestorei & chr(34) & " " & chr(34) & PathUSMT & "\" & ComputerBackup & chr(34)
|
||||
CodeExe = Shell.run("cmd /c cscript " & chr(34) & CRestorei & chr(34) & " " & chr(34) & PathUSMT & "\" & ComputerBackup & chr(34),,True)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , ComputerBackup & " | " & "End Custom = " & CodeExe
|
||||
|
||||
If CodeExe = 0 Then
|
||||
Custom_Result.innerHTML = "End Custom = " & CodeExe
|
||||
Else
|
||||
Custom_Result.innerHTML = "<span style=" & chr(34) & "font-weight: bold; color: rgb(255, 0, 0);" & chr(34) & ">" & "End Custom = " & CodeExe & "</span>"
|
||||
End If
|
||||
|
||||
CodeExit = CodeExit + CodeExe
|
||||
Bouton_Log2.innerHTML = "<input id=" & chr(34) & "runbutton" & chr(34) & " class=" & chr(34) & "button" & chr(34) & " value=" & chr(34) & "Log Custom" & chr(34) & " name=" & chr(34) & "Log" & chr(34) & " onclick=" & chr(34) & "Lance_logsCustomRestore" & chr(34) & " type=" & chr(34) & "button" & chr(34) & ">"
|
||||
End If
|
||||
If Fso.FileExists(PatchUSMTSTART & "\tools\commandeapres.bat") then
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "Start=" & chr(34) & PatchUSMTSTART & "\tools\commandeapres.bat" & chr(34) & " " & chr(34) & PathUSMT & "\" & ComputerBackup & chr(34)
|
||||
CodeExe = Shell.run(chr(34) & PatchUSMTSTART & "\tools\commandeapres.bat" & chr(34) & " " & chr(34) & PathUSMT & "\" & ComputerBackup & chr(34),,True)
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "exitcode=" & codeexe
|
||||
|
||||
If CodeExe = 0 Then
|
||||
Custom_commande.innerHTML = "End Commande = " & CodeExe
|
||||
Else
|
||||
Custom_commande.innerHTML = "<span style=" & chr(34) & "font-weight: bold; color: rgb(255, 0, 0);" & chr(34) & ">" & "End Commande = " & CodeExe & "</span>"
|
||||
End If
|
||||
|
||||
CodeExit = CodeExit + CodeExe
|
||||
Else
|
||||
TraceLog PatchUSMTSTART & "\USMTstart.log" , StrComputerName & " | " & "not exist=" & chr(34) & PatchUSMTSTART & "\tools\commandeapres.bat" & chr(34)
|
||||
End If
|
||||
If Fso.FileExists(PathUSMT & "\flag.txt") Then CodeRetour = Fso.DeleteFile(PathUSMT & "\flag.txt",True)
|
||||
End If
|
||||
'ListUsr.innerHTML = ""
|
||||
|
||||
If Instr(Argument,"RESTORE") <> 0 Then self.close(CodeExit)
|
||||
End Sub
|
||||
|
||||
Function TraceLog(FichierLog,Commentaire)
|
||||
Dim oFso, fich
|
||||
Set oFso = CreateObject("Scripting.FileSystemObject")
|
||||
Set fich = oFso.OpenTextFile(FichierLog,8,True)
|
||||
fich.writeline cstr(Date) & " " & cstr(Time) & " | " & Commentaire
|
||||
fich.close
|
||||
End Function
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body background = "Images\image.jpg">
|
||||
<div style="text-align: center;"><big><span
|
||||
style="font-weight: bold;"><BIG>Backup / Restore</BIG></span></big><br>
|
||||
|
||||
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td> <br></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span style="font-weight: bold;"><div style="text-align: center;"> Sauvegarder cet ordinateur <br> </div></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<span style="font-weight: bold;"><div style="text-align: center;">Restaurer depuis un ordinateur <br> </div></span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="text-align: center;">Selectionner les profils a sauvegarder <br> </div>
|
||||
<div style="text-align: center;"> <span id="ListUsr"></span> <br> </div>
|
||||
<div style="text-align: center;"><input id="runbutton" class="button" value="Backup" name="ExportMDT" onclick="Lance_Scanstate" type="button">
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div style="text-align: center;">Selectionner l'ordinateur a restaurer <br> </div>
|
||||
<div style="text-align: center;"><div style="text-align: center;"> <span id="USMT_Current"></span> <br> </div>
|
||||
<input id="runbutton" class="button" value="Restore" name="ExportMDT" onclick="Lance_Loadstate" type="button">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<BR>
|
||||
<table style="text-align: left; width: 100%;" border="0"
|
||||
cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr align="center">
|
||||
<td><span id="USMT_Result"></span> <br></td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td><span id="Custom_Result"></span></td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td><span id="Custom_commande"></span></td>
|
||||
</tr>
|
||||
|
||||
<tr align="center">
|
||||
<td><span id="Bouton_Log1"> </span><span id="Bouton_Log2"></span></td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td><span id="Bouton_Diff"></span></td>
|
||||
</tr>
|
||||
|
||||
<tr align="center">
|
||||
<td><span id="Bouton_view"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
32
USMT-Gui-Replace-Scenario/readme.md
Normal file
32
USMT-Gui-Replace-Scenario/readme.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# USMT Start (Legacy HTA)
|
||||
|
||||
Legacy **HTA GUI** to run **USMT** backup/restore with a simple workflow.
|
||||
Select user profiles to back up, choose a source computer to restore, view logs, and launch helper tools.
|
||||
|
||||
## What it does
|
||||
- Detects OS and picks the matching **USMT** binaries (x86/x64, Win7/8.1/10 paths).
|
||||
- **Backup (scanstate)**: select users (auto‑excludes via `USMTStart.ini` and generated `USMTExcludeDrives.xml`), writes to `USMT\<COMPUTERNAME>\`.
|
||||
- **Restore (loadstate)**: select a previous computer folder to import.
|
||||
- Optional custom hooks: `Tools\commandeavant.bat` and `Tools\commandeapres.bat`.
|
||||
- Opens logs with **Trace32** and views MIG content with **MigViewer**.
|
||||
- Logs operations to `USMTstart.log`, `USMTBackup.log`, `USMTRestore.log`, `Custom*.log`.
|
||||
|
||||
## Files
|
||||
- `USMTStartV4.3.hta` — main GUI
|
||||
- `USMTStart.ini` — exclusions (`[ExcludeUsers]`, etc.)
|
||||
- `Start.bat` — launcher (optional)
|
||||
- `Tools\` — USMT versions, `trace32.exe`, `MigViewer.exe`, `CustomBackup.vbs`, `CustomRestore.vbs`, `USMTExcludeDrives.*`, optional `commandeavant.bat` / `commandeapres.bat`
|
||||
|
||||
## Usage
|
||||
- **Backup**: run the HTA → pick user profiles → **Backup**.
|
||||
- **Restore**: run the HTA → choose source computer → **Restore**.
|
||||
|
||||
### Command‑line (silent triggers)
|
||||
- `USMTStartV4.3.hta BACKUP` — start backup immediately.
|
||||
- `USMTStartV4.3.hta RESTORE` — start restore for selected computer.
|
||||
- `USMTStartV4.3.hta RESTORE COMPUTER=<OldPCName>` — restore from a specific folder.
|
||||
|
||||
## Notes
|
||||
- Requires **Windows Scripting Host** + **USMT** files present under `Tools\`.
|
||||
- Some operations may require **Administrator** rights.
|
||||
- Paths and tools are hard‑coded to the `Tools\` tree; adjust if you reorganize.
|
||||
0
USMT-Gui-Replace-Scenario/release20161130_1.txt
Normal file
0
USMT-Gui-Replace-Scenario/release20161130_1.txt
Normal file
Reference in New Issue
Block a user