1
0

Auto-commit: 2025-10-31 08:58:35

This commit is contained in:
David Wuibaille
2025-10-31 08:58:36 +01:00
parent 7d94414992
commit 7cc3011354
1088 changed files with 193455 additions and 0 deletions

Binary file not shown.

View File

@@ -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

View 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

View 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

View 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

View 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

View 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

Binary file not shown.

View 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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View 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.

View 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__) */

File diff suppressed because it is too large Load Diff

View 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"

View 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%"

View 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

Binary file not shown.

View 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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.