Sie sind auf Seite 1von 44

Codigo Fuente System File Checker 4.

8 (by HTAsoft - Fredledingue) - July 2011 ______________________________________________________

DESCRIPTION:

-Quickely compare files to help you to track changes in your system. -Scan the root of drive C, the Windows folder, the Program File folder and folders of your choice. -Allow exclude list, easy configuration, autodect recommanded folders etc. -Shows result in html tables including name, size, date and version -Faster than similar applications.

ATTENTION: Results may differ from reality!

'--------Set constants-----MyTitle = "Installed Files Checker 4.8" Dim fso Set fso = CreateObject("Scripting.FileSystemObject") '----debug--'Set DebugFile = fso.CreateTextFile("debug.txt", True) 'Set DebugFileA = fso.CreateTextFile("debugA.txt", True) 'Set DebugFileB = fso.CreateTextFile("debugB.txt", True) '--------lit les argument d lancement----If WScript.Arguments.Count=0 Then SysCheckFile = "" If MsgBox ("warning:"_ & VbCrlf & "This program will work without progress bar!" _ & VbCrlf & "(And it can take a while...)" _ & VbCrlf & "To use this program with a progress bar, use the HTA interface ""CheckSystem*.hta""." _ & VbCrlf & "Do you want to continue without progress bar?", 4+48, MyTitle) = 7 Then MsgBox "Action canceled",,MyTitle WScript.Quit End if MyComment = InputBox("Enter your comment for the report", MyTitle,, 520, 340) NoArgument = True ElseIf Len(WScript.Arguments(0)) < 10 Then MsgBox "Invalid argument, action canceled.",0+16, MyTitle & " - ERROR" WScript.CreateObject("WScript.Shell").RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",-1,"REG_SZ" WScript.Quit

Else NoArgument = False SysCheckFile = WScript.Arguments(0) '-------Lit le commentaire-----Wscript.Sleep 300 If fso.FileExists("tempcomment.txt")=True Then Set f = fso.GetFile("tempcomment.txt") If f.size > 1 Then Set ts = f.OpenAsTextStream(1) MyComment = ts.ReadAll ts.Close Else MyComment = "(no comment)" End If End If End If '--------Set constants-----Dim nUB,OutputFile,BatFile,ExcludeList,ErrorList,SizeA,DateA,VerA,ParentDir Dim NameA,NameB,TempListA,TempListB,EstPlace,EstPlace2,FolPath,FolFound,FileFound,L oopCount Dim a,e,f,g,h,i,j,k,l,m,n,x,ad,mi,mo,ubla,ublb,ubfl,ubad,ubmi,ubmo,ubtla,ubtlb,isvc,os,IsPM Set WshShell = WScript.CreateObject("WScript.Shell") '--------Configuration----If fso.FileExists("ifc.ini")=False Then If NoArgument = True Then MsgBox "Thanks for using Installed Files Checker!" _ & VbCrlf & "Click ""OK"" to proceed with the configuration settings.",0+64,MyTitle WshShell.Run "ifc_config13.hta",1,True End If End If '------check registry----On Error Resume Next r = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\CheckSystemHtml") If err.Number <>0 Then r=0 WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" err.Clear End If v = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\WScriptVersion") If err.Number <>0 Or v=0 Or v="" Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\WScriptVersion",WScript.Version,"REG_SZ" err.Clear End If On Error GoTo 0 If r<8 And r>0 Then If MsgBox("Either the program didn't terminate normaly last time," _ & VbCrlf & "or another instance of this program is running." _ & VbCrlf & "Click ""Retry"" if you are sure that the program is not running already." , 5+48, MyTitle) = 4 Then '--retry WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" Else MsgBox "Action canceled", 0+48, MyTitle WScript.Quit End if

ElseIf r=-1 Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" End If '-------time debug------time1=Timer '--------Cre le nom d fichier------Dates = Now If SysCheckFile = "" Then SysCheckFile = "SystemCheck_" & Right(Year(Dates),2) & Right( "0" & Month(Dates),2 ) & Right( "0" & Day(Dates),2 ) _ & "_" & Right( "0" & Hour(Dates),2) & Right( "0" & Minute(Dates),2 ) & Right( "0" & Second(Dates),2 ) & ".htm" End If '---------renomme les listes-------If fso.FileExists("WINF_A.TXT")=True And fso.FileExists("WINF_B.TXT")=True Then fso.GetFile("WINF_A.TXT").Delete fso.GetFile("WINF_B.TXT").Move "WINF_A.TXT" '------A = vieille liste, B = nouvelle liste End If '___________Cre le fichier batch "ifc.bat" qui prendra la liste ds fichiers existants_________ '-----cre "InvalidPathsIndex.txt" si il n'existe pas----If fso.FileExists("InvalidPathsIndex.txt")=False Then Set OutputFile = fso.CreateTextFile("InvalidPathsIndex.txt", True) OutputFile.WriteLine "" OutputFile.Close End If '---------prend la taille de ifc.bat-------If fso.FileExists("ifc.bat")=True Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", fso.GetFile("ifc.bat").Size ,"REG_SZ" Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", 50000,"REG_SZ" End If '------Prend les listes des dossiers inclus et exclus et nettoye les tabs et les espaces blancs par dessus le march-----Set ts = fso.GetFile("ifc.ini").OpenAsTextStream(1) Do Until InStr(t, "Root of Drive ") >0 t=ts.ReadLine Loop t=ts.ReadLine Do Until InStr(t, "[Folders excluded]") >0 If t<>"" Then ScanList = t & VbCrlf & ScanList End If t = RTrim( LTrim( Replace(ts.ReadLine, VbTab, "") ) ) Loop t=ts.ReadLine Do Until InStr(t, "[Settings]") >0 If t<>"" Then ExcludeList = t & VbCrlf & ExcludeList End If t = RTrim( LTrim( Replace(ts.ReadLine, VbTab, "") ) ) Loop ts.Close '------Debug Set debuga = fso.CreateTextFile("debuga.txt", True)

Set debugb = fso.CreateTextFile("debugb.txt", True) '-------Efface le fichier "WINF_B.TXT"---Set OutputFile = fso.CreateTextFile("WINF_B.TXT", True) OutputFile.WriteLine Dates OutputFile.Close '-----Ecrit le dbut du fichier bat------Set BatFile = fso.OpenTextFile("ifc.bat", 2, -1) BatFile.WriteLine "@echo off" BatFile.WriteLine "set list=WINF_B.TXT" BatFile.WriteLine "dir C:\ /O:GN /-P>> %list%" BatFile.WriteLine "dir C:\ /O:GN /A:S /-P>> %list%" BatFile.WriteLine "dir C:\ /O:GN /A:H /-P>> %list%" WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",1,"REG_SZ" '------Procde avec les dossiers inclus ands scanlist pour crire le corps du fichier bat----ExclArray = Split(ExcludeList, VbCrlf) For Each FolderToDo In Split(ScanList, VbCrlf) If InStr(FolderToDo,":\")=2 Then If fso.FolderExists(FolderToDo) = True Then '--------prcdament: Function DoSearch--'FolderToDo = fso.GetFolder(FolderToDo).ShortPath '------crit batch temporaire et le lance---fso.CreateTextFile "tempdir.txt", True With fso.OpenTextFile("temp2.bat", 2, -1) .WriteLine "@echo off" .WriteLine "set list=tempdir.txt" .WriteLine "dir """ & FolderToDo & """ /A:D /S /B /-P >> %list%" .WriteLine "echo. >> %list%" .WriteLine "echo Ok." .WriteLine "cls" .WriteLine "exit" .Close End With WshShell.Run "temp2.bat",0,True '----crit batch----BatFile.WriteLine "dir """ & FolderToDo & """ /O:GN /-P>> %list%" BatFile.WriteLine "dir """ & FolderToDo & """ /A:S /O:GN /-P>> %list%" BatFile.WriteLine "dir """ & FolderToDo & """ /A:H /O:GN /-P>> %list%" '------debug---'tdebug = "debug_" & Replace( Mid(FolderToDo, InStr(FolderToDo, "\")+1 ) ,"." ,"") & ".txt" 'fso.GetFile("tempdir.txt").Copy tdebug '-----Lit le rsultat du batch temporarire qui doit lister tous les sous-directorys---Set ts = fso.GetFile("tempdir.txt").OpenAsTextStream(1) On Error Resume Next LongPath = ts.ReadLine Do Until ts.AtEndOfStream p = fso.GetFolder(LongPath).ShortPath FolFound = False If err.Number>0 Then Err.Clear For Each Excl In ExclArray If Excl<>"" Then If InStr(1, LongPath, Excl, 1)=1 Then FolFound = True Exit For

End If End If Next If FolFound = False Then ErrorList = LongPath & VbCrlf & ErrorList End If Else For Each Excl In ExclArray If Excl<>"" Then If InStr(1, LongPath, Excl, 1)=1 Or InStr(1, p, Excl, 1)=1 Then FolFound = True Exit For End If End If Next If FolFound = False Then BatFile.WriteLine "dir """ & LongPath & """ /O:GN /-P>> %list%" BatFile.WriteLine "dir """ & LongPath & """ /A:S /O:GN /-P>> %list%" BatFile.WriteLine "dir """ & LongPath & """ /A:H /O:GN /-P>> %list%" End If End If LongPath = ts.ReadLine Loop On Error GoTo 0 End If End If Next '------corrige les erreurs pour les chemins non valable parceque contenant des caractres spciaux------Set ts = fso.GetFile("InvalidPathsIndex.txt").OpenAsTextStream(1) wpIndex = Split(ts.ReadAll, VbCrlf) ubwpi = UBound(wpIndex) ts.Close WrongPaths = Split(ErrorList, VbCrlf) For h=0 To UBound(WrongPaths) wp = WrongPaths(h) If Len(wp) > 3 Then gpFound = False '------cherche dans wpIndex-----For i=0 To ubwpi If Instr(wpIndex(i), wp)=1 And InStr(wpIndex(i), VbTab)>0 Then WrongPaths(h) = wpIndex(i) gpFound = True End If Next '-------cherche d'aprs la longuer du nom----If gpFound = False Then wp2="" For i=1 To Len(wp) c=Asc(Mid(wp,i,1)) If c<32 Or c>126 Then wp2 = wp2 & Chr(130) Else wp2 = wp2 & Mid(wp,i,1)

End If Next wp=wp2 d=Split(wp, "\") FindLenWp End If '-------cherche en remplacant le mauvais caractre--If gpFound = False Then For i=128 To 255 gp = Replace(wp, Chr(130), Chr(i)) If fso.FolderExists(gp)=True Then WrongPaths(h) = WrongPaths(h) & VbTab & gp gpFound = True Exit For End If Next End If '-------cherche en remplacant le mauvais caractre si il y en a deux--If gpFound = False Then wpa = Split(wp, Chr(130) ) ubwpa = UBound(wpa) If ubwpa=2 Then For i=128 To 255 For j=128 To 255 gp = wpa(0) & Chr(i) & wpa(1) & Chr(j) & wpa(2) If fso.FolderExists(gp)=True Then WrongPaths(h) = WrongPaths(h) & VbTab & gp gpFound = True Exit For End If Next Next End If End If '-----------demande de chercher manuellement si introuvable-------If gpFound = False Then wpa = Split(wp,"\") ubwpa = UBound(wpa) wp2 = wpa(ubwpa-1) & "\" & wpa(ubwpa) ParentName = fso.GetFolder(ParentDir).Name wp2 = Mid(wp, InStr(wp,ParentName) + Len(ParentName)+1 ) If Len(wp2)>50 Then wp2 = "..." & Right(wp2,50) End If Set objFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Please find:" & VbCrlf & wp2, 0, ParentDir) If objFolder Is Nothing Then MsgBox "No folder selected:" _ & VbCrlf & "The program won't be able to check this folder" _ & VbCrlf & "because its path contains invalid characters and cannot be found:" _ & VbCrlf _ & VbCrlf & wp ,0+48,MyTitle Else gp = objFolder.Items.Item.path WrongPaths(h) = WrongPaths(h) & VbTab & gp

End If Set objFolder = Nothing End If End If Next '------Ecrit la fin du fichier bat-----BatFile.WriteLine "echo. >> %list%" BatFile.WriteLine "echo. >> %list%" BatFile.WriteLine "cls" BatFile.WriteLine "exit" BatFile.Close '________________Cre la liste des fichiers existants cad: "WINF_B.TXT"________________ '---------prend la taille de WINF_A.TXT-------If fso.FileExists("WINF_A.TXT")=True Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", fso.GetFile("WINF_A.TXT").Size ,"REG_SZ" Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", 3000000 ,"REG_SZ" End If '----lance bat----WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",2,"REG_SZ" WshShell.Run "ifc.bat",0,True WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",3,"REG_SZ" '------rcrit l'index des dossiers introuvables par le DOS---Set OutputFile = fso.OpenTextFile("InvalidPathsIndex.txt", 2, -1) OutputFile.WriteLine Join(WrongPaths, VbCrlf) OutputFile.Close '-------ajoute les listings des dossiers introuvables par le DOS en imitant le DIR----Set OutputFile = fso.OpenTextFile("WINF_B.TXT", 8, -1) With OutputFile For Each wp In WrongPaths If InStr(wp, VbTab)>0 Then gp = Mid(wp, InStr(wp, VbTab)+1) Set folder = fso.GetFolder(gp) For Each Excl In ExclArray If Excl<>"" Then If InStr(1, gp, Excl, 1)=1 Or InStr(1, folder.ShortPath, Excl, 1)=1 Then FolFound = True Exit For End If End If Next If FolFound = False Then .WriteLine "" .WriteLine " Directory of " & folder.Path .WriteLine "" .WriteLine ".. " '----Attention: guarder l'espace blanc aprs les deux points For Each file In folder.Files .WriteLine "XXX XXX " _ & FormatNumber(file.size,0,0,0,-1) & " " _ & file.DateLastModified & " " _ & file.name Next End If End If Next

.Close End With '-----------premire fois-----If fso.FileExists("WINF_A.TXT")=False Then fso.CreateTextFile("WINF_A.TXT") '------cre "WINF_A.TXT" une premire fois WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",9,"REG_SZ" '------Ecrit Reports Comment Index---If fso.FileExists("Reports_Comment_Index.htm") = False Then Set OutputFile = fso.CreateTextFile("Reports_Comment_Index.htm", True) With OutputFile .WriteLine "<html><head><title>SysFileChecker Reports Index</title></head><body>" .WriteLine "<p align=""center"">" .WriteLine "<font color=""#00FF00"" size=""4"">Installed Files Checker Reports Index</font>" .WriteLine "</p>" .WriteLine "<hr>" .WriteLine "Initial list of files created on " & FormatDateTime(Date,VBLongDate) .WriteLine "<hr>" .Close End With MsgBox "Reports Comment Index created!" _ & VbCrlf & "Open or double-click ""Reports_Comment_Index.htm"" in the program's folder" _ & VbCrlf & "to view the reports in your Internet browser.", 0+64, MyTitle End If '-------MsgBox "First time use: No change. Please run this program again whenever you want.", 0+64, MyTitle Wscript.Quit End If '________________Compare les 2 listes________________ '--------Progrs-------WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",4,"REG_SZ" '--------Cherche la date de l'ancienne liste ----Set ts = fso.GetFile("WINF_A.TXT").OpenAsTextStream(1) Dates = ts.ReadLine & " to " & Dates '------Vrifie le type de liste faite en DOS (version W98 ou XP)-----Do Until InStr(t, "..")>0 t=ts.ReadLine Loop If InStr(t, ".. ")>0 Then os="W98" ElseIf InStr(t, " ..")>0 Then os="XP" '------Vrifie la maniere dont l'heure est ecrite-----Do Until InStr(t, "<DIR>")>0 t=ts.ReadLine Loop Do Until InStr(t, " ")=0 t=Replace(t," "," ") Loop t = Split( UCase(t), " ")(2) If t="PM" Or t="AM" Then IsPM = 1 Else IsPM = 0

End If Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",1,"REG_SZ" MsgBox "The program couldn't define the DOS version on your computer." _ & VbCrlf & "Operation canceled", 0+16, MyTitle & " - ERROR" WScript.Quit End If '--------Ouvre les fichiers contenant les listes et spare les liste par directory----ts.Close '------oblig de refermer le fichier si non il y a une erreur incomprhensible! Set ts = fso.GetFile("WINF_A.TXT").OpenAsTextStream(1) ListA = Split(ts.ReadAll, VbCrlf & " Directory of ") ts.Close Set ts = fso.GetFile("WINF_B.TXT").OpenAsTextStream(1) ListB = Split(ts.ReadAll, VbCrlf & " Directory of ") ts.Close '---------Forme les plages-----ubla = UBound(ListA) ublb = UBound(ListB) ReDim Folindex(ubla) ReDim fl(50) ubfl=50 a=0 i=0 '---------Create Index of folders-----For i=0 To ubla isvc = InStr(ListA(i), VbCrlf)-1 If isvc > 1 Then Folindex(i) = Left(ListA(i),isvc) Else Folindex(i) = "" End If Next i=0 '-------Scan ListB------EstPlace=1 AddFolCount=0 ModFileCount=0 MissFileCount=0 MissFolCount=0 AddFileCount=0 z=0 '-------Progrs----WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", ublb,"REG_SZ" WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileDone", 0,"REG_SZ" WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckingFolder", "?","REG_SZ" WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml", 5,"REG_SZ" '------------------For h=1 To ublb l = ListB(h) isvc = InStr(l, VbCrlf)-1 If isvc > 1 Then ReDim Added(50) ubad=50 ad=0 ReDim Missing(50) ubmi=50 mi=0 ReDim Modified(50) ubmo=50

mo=0 '-------NOUVEAU---Donne le nom de ce directory ---FolPath = Left(l,isvc) '----debug---'DebugFile.Write FolPath 'debugtime1 = Timer '--------If Len(Folpath)>50 Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckingFolder", Left(Folpath, 24) & "..." & Right(Folpath, 24),"REG_SZ" Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckingFolder", Folpath,"REG_SZ" End If '-------cherche le dossier dans l'index-----FolFound = False For i=EstPlace To ubla If Folpath = Folindex(i) Then EstPlace=i FolFound = True Exit For End If Next If FolFound = False Then For i=0 To EstPlace If Folpath = Folindex(i) Then EstPlace=i FolFound = True Exit For End If Next End If '-----------si il l'a trouv------------If FolFound = True Then Folindex(i) = "" '--------prend le premier dir des ListA et B--TempListA = Mid( ListA(i), isvc+5, InStr(1, ListA(i), " File(s) ", 1) ) '--Attention 'InStrRev' ne supporte pas les parametres '1,' et ',1' TempListB = Mid( ListB(h), isvc+5, InStr(1, ListB(h), " File(s) ", 1) ) '-------Efface si identique---'----debug--'If Len(TempListA)<1000 And debugx<200 Then 'DebugFileA.WriteLine TempListA 'DebugFileA.WriteLine "______________" 'DebugFileB.WriteLine TempListB 'DebugFileB.WriteLine "______________" 'End If '------If TempListA = TempListB Then TempListA = "" TempListB = "" End If '------complete ListA avec les listes suivantes appartenant au mme dossier----'--Note: "Some folders are listed twice, in two separate tables" ===> rsoudre a demanderait '--qu'on rescan toute la liste des dossier, a prendrait trop d temp. Donc je laisse ce bogue l. If i<ubla Then

i=i+1 Do While Folpath = Folindex(i) TempListA = TempListA & VbCrlf & Mid( ListA(i), isvc+5, InStr(1, ListA(i), " File(s) ", 1) ) Folindex(i) = "" i=i+1 If i>ubla Then Exit Do End If Loop End If '------complete ListB avec les listes suivantes appartenant au mme dossier----If h<ublb Then h=h+1 l = ListB(h) isvc = InStr(l, VbCrlf)-1 Do While FolPath = Left(l,isvc) TempListB = TempListB & VbCrlf & Mid( l, isvc+5, InStr(1, l, " File(s) ", 1) ) h=h+1 If h>ublb Then Exit Do End If l = ListB(h) isvc = InStr(l, VbCrlf)-1 Loop h=h-1 End If '-------Efface si identique---If TempListA = TempListB Then TempListA = "" TempListB = "" Else '--------Trie les deux listes------tla = Split(TempListA, VbCrlf) ArraySort tla debuga.WriteLine Join(tla, VbCrlf) tlb = Split(TempListB, VbCrlf) ArraySort tlb debugb.WriteLine Join(tlb, VbCrlf) '--------Avance dans les deux listes jusqu'au premier changement------ubtla=UBound(tla) ubtlb=UBound(tlb) EstPlace2=0 e=0 g=0 '-------NOUVEAU---Donne le nom de ce directory si ncessaire '---deplace plus haut 'If ubtlb + ubtla > 800 Then 'End If '---------Do While tla(g)="" g=g+1 Loop Do While Left(tla(g),1)=" " And g < ubtla g=g+1 Loop

Do While tlb(e)="" e=e+1 Loop Do While Left(tlb(e),1)=" " And e < ubtlb e=e+1 Loop If g < ubtla And e < ubtlb Then Do While tla(g)=tlb(e) And g < ubtla And e < ubtlb g=g+1 e=e+1 Loop End If '--------Compare les deux listes------k=g EstPlace2=e For g=k To ubtla tlag=tla(g) '---necessaire pour eviter de changer tla(g) par la fonction Getname NameA = GetName(tlag) If NameA<>"" Then FileFound=False For e=EstPlace2 to ubtlb tlbe = tlb(e) '---necessaire pour eviter de changer tla(g) par la fonction Getname NameB = GetName(tlbe) If NameB<>"" Then If NameA=NameB Then If tla(g) <> tlb(e) And InStr(1, tla(g), "<DIR>", 1)=0 Then '---NOUVEAU VERSION 4.8 '---Verifie si les fichiers sont vraiment differents au cas ou les version du dos le serait--SplitDatas tlb(e) SizeB = SizeA DateB = DateA SplitDatas tla(g) If SizeB <> SizeA Then Modified(mo) = tla(g) & "===>" & tlb(e) : mo=mo+1 ElseIf DateDiff("n", DateB, DateA) <> 0 Then If Month(DateB) <> Day(DateA) _ Or Day(DateB) <> Month(DateA) _ Or Year(DateB) <> Year(DateA) _ Or Hour(DateB) <> Hour(DateA) _ Or Minute(DateB) <> Minute(DateA) Then Modified(mo) = tla(g) & "===>" & tlb(e) : mo=mo+1

End If End If If mo>ubmo Then ubmo=ubmo+50 ReDim Preserve Modified(ubmo) End If End If '------EstPlace2=e+1 FileFound=True Exit For ElseIf NameA < NameB Then EstPlace2=e Exit For Else Added(ad) = tlb(e) ad=ad+1 If ad>ubad Then ubad=ubad+50 ReDim Preserve Added(ubad) End If End If End If Next If FileFound=False Then Missing(mi) = tla(g) mi=mi+1 If mi>ubmi Then ubmi=ubmi+50 ReDim Preserve Missing(ubmi) End If End If End If Next If e < ubtlb Then For e=EstPlace2 to ubtlb tlbe = tlb(e) '---necessaire pour eviter de changer tla(g) par la fonction Getname NameB = GetName(tlbe) If NameB <> "" Then Added(ad) = tlb(e) ad=ad+1 If ad>ubad Then ubad=ubad+50 ReDim Preserve Added(ubad) End If End If Next End If '----se refere a "If e < ubtlb" End If '----se refere a "If TempListA = TempListB" End If '----se refere a "If FolFound = True"

'___________Ajoute le rsultat de ce dossier dans la plage ds rsultats (fl)_________ '--------Cas de dossier introuvable------If FolFound = False Then fl(a) = Folpath & " [NEW FOLDER]" & VbCrlf & "-------------------" & VbCrlf '------complete et trie ListB avec les listes suivantes appartenant au mme dossier----TempListB = Mid( ListB(h), isvc+2) If h<ublb Then h=h+1 l = ListB(h) isvc = InStr(l, VbCrlf)-1 Do While FolPath = Left(l,isvc) TempListB = TempListB & VbCrlf & Mid( ListB(h), isvc+5) h=h+1 If h>ublb Then Exit Do End If l = ListB(h) isvc = InStr(l, VbCrlf)-1 Loop h=h-1 End If tlb = Split(TempListB, VbCrlf) ArraySort tlb ubtlb=UBound(tlb) '---------procde avec les lments de la liste----e=0 Do While tlb(e)="" e=e+1 Loop Do While Left(tlb(e),1)=" " And e < ubtlb e=e+1 Loop If os = "W98" Then Do Until Left(tlb(e),3)=".. " Or e=ubtlb-1 e=e+1 Loop ElseIf os = "XP" Then Do Until Right(tlb(e),3)=" .." Or e=ubtlb-1 e=e+1 Loop End If k=e+1 LoopCount=0 If k=ubtlb Then If Left(tlb(k),19) = "Total files listed:" Or Left(tlb(k),3) = ".. " Or Right(tlb(k),3) = " .." Then fl(a) = fl(a) & "[EMPTY]" & VbCrlf Else fl(a) = fl(a) & "ADDED:" & VbCrlf & tlb(k) & VbCrlf End If Else fl(a) = fl(a) & "ADDED:" & VbCrlf For e=k To ubtlb tlbe = tlb(e) If tlbe <> "" _ And Left(tlbe,3) <> ".. " _

And Right(tlbe,3) <> " .." _ And Left(tlbe,1) <> " " _ And Left(tlbe,19)<>"Total files listed:" Then fl(a) = fl(a) & tlbe & VbCrlf LoopCount = LoopCount + 1 End If Next If LoopCount=0 Then fl(a) = Replace(fl(a), "ADDED:", "[EMPTY]") End If End If fl(a) = fl(a) & "-------------------" & VbCrlf '---------ajoute au dcompte des dossiers en plus--------AddFolCount = AddFolCount + 1 AddFileCount = AddFileCount + LoopCount a=a+1 If a>ubfl Then ubfl=ubfl+50 ReDim Preserve fl(ubfl) End If Else '--------Cas de dossier trouv------'------sauve les dcomptes---ModFileCount = ModFileCount + mo MissFileCount = MissFileCount + mi AddFileCount = AddFileCount + ad '---------i=0 If Modified(i)<>"" Then fl(a) = fl(a) & "MODIFIED:" & VbCrlf For i=0 To ubmo If Modified(i)="" Then Exit For Else fl(a) = fl(a) & Modified(i) & VbCrlf End If Next fl(a) = fl(a) & "-------------------" & VbCrlf i=0 End If If Missing(i)<>"" Then fl(a) = fl(a) & "MISSING:" & VbCrlf For i=0 To ubmi If Missing(i)="" Then Exit For Else fl(a) = fl(a) & Missing(i) & VbCrlf If InStr(1, Missing(i),"<DIR>", 1)>0 Then MissFileCount = MissFileCount -1 If FolPath = "C:\" Then MissFolCount = MissFolCount +1 End If End if End If Next fl(a) = fl(a) & "-------------------" & VbCrlf i=0 End If

If Added(i)<>"" Then fl(a) = fl(a) & "ADDED:" & VbCrlf For i=0 To ubad If Added(i)="" Then Exit For Else fl(a) = fl(a) & Added(i) & VbCrlf If InStr(1, Added(i),"<DIR>", 1)>0 Then AddFileCount = AddFileCount -1 If FolPath = "C:\" Then AddFolCount = AddFolCount +1 End If End if End If Next fl(a) = fl(a) & VbCrlf & "-------------------" & VbCrlf i=0 End If If fl(a)<>"" Then fl(a) = Folpath & VbCrlf & "-------------------" & VbCrlf & fl(a) a=a+1 If a>ubfl Then ubfl=ubfl+50 ReDim Preserve fl(ubfl) End If End If End If '----rfre "If FolFound = False Then" '----debug---'DebugFile.WriteLine Timer - debugtime1 '--------End If '------rfre "If isvc > 1 Then" z=z+1 If z=30 Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileDone", h,"REG_SZ" z=0 End If Next '--------rfre "For h=0 To ublb" '__________Cherche les dossiers manquants_________ 'MsgBox "ok, continuez" ,,"debug 1" '-------Progrs------WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",6,"REG_SZ" '-----------------EstPlace=1 For j=1 To ubla If Folindex(j)<>"" Then FolFound = False For i=EstPlace To ublb l = ListB(i) isvc = InStr(l, VbCrlf)-1 If isvc > 1 Then FolPath = Left(l,isvc) If Folpath = Folindex(j) Then EstPlace=i FolFound = True Exit For End If End If

Next If FolFound = False Then For i=0 To EstPlace l = ListB(i) isvc = InStr(l, VbCrlf)-1 If isvc > 1 Then FolPath = Left(l,isvc) If Folpath = Folindex(j) Then EstPlace=i FolFound = True Exit For End If End If Next End If '----s'il ne l'a pas trouv----If FolFound = False Then Folpath = Folindex(j) isvc = Len(Folpath) fl(a) = Folpath & " [MISSING FOLDER]" & VbCrlf & "------------------" & VbCrlf '------complete et trie ListA avec les listes suivantes appartenant au mme dossier----TempListA = Mid( ListA(j), isvc+2) If j<ubla Then j=j+1 l = ListA(j) isvc = InStr(l, VbCrlf)-1 Do While FolPath = Left(l,isvc) TempListA = TempListA & VbCrlf & Mid( ListA(j), isvc+5) j=j+1 If j>ubla Then Exit Do End If l = ListA(j) isvc = InStr(l, VbCrlf)-1 Loop j=j-1 End If '---------procde avec les lments de la liste-----CHANGE tla = Split(TempListA, VbCrlf) ArraySort tla ubtla=UBound(tla) LoopCount=0 fl(a) = fl(a) & "MISSING:" & VbCrlf For g=0 To ubtla tlag=tla(g) NameA = GetName(tlag) If NameA <> "" Then fl(a) = fl(a) & tla(g) & VbCrlf LoopCount = LoopCount + 1 End If Next If LoopCount=0 Then fl(a) = Replace(fl(a), "MISSING:", "[EMPTY]") End If fl(a) = fl(a) & "-------------------" & VbCrlf '---------ajoute au dcompte des dossiers en plus--------MissFolCount = MissFolCount + 1

MissFileCount = MissFileCount + LoopCount a=a+1 If a>ubfl Then ubfl=ubfl+50 ReDim Preserve fl(ubfl) End If End If End If Next '-------Progrs------WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",7,"REG_SZ" 'MsgBox "ok, continuez" ,,"debug 2" '-----------Nettoye la mmoire-------Erase ListA Erase ListB Erase Folindex Erase tla Erase tlb TempListA = Null TempListB = Null l=Null '------------trie les dossiers------For i=1 To ubfl v = fl(i) If InStr(v, VbCrlf)>0 Then f = Left(v, InStr(v,VbCrlf)-1) j=i Do While Left(fl(j-1), InStr(fl(j-1),VbCrlf)-1) > f fl(j) = fl(j-1) j=j-1 If j<=0 Then Exit Do End If Loop fl(j) = v End If Next 'MsgBox nfdebug & " ok, continuez" ,,"debug 3" '---Debug '_______________Converti en html_____________ '--------Cre le fichier pour les rsultats-----Set OutputFile = fso.CreateTextFile(SysCheckFile, True) With OutputFile '--------Ecrit dans le fichier SystemCheck l'entete, les dates et les heures des vrifications---------.WriteLine "<html><head><title>SysFileChecker Report</title>" .WriteLine "<script type=""text/javascript"">" .WriteLine "function fixLayout() {var tn = document.body.getElementsByTagName('table')" .WriteLine " if (tn[0].style.tableLayout == 'auto')" .WriteLine " {for (var i = 0; i < tn.length; i++) {tn[i].style.tableLayout = 'fixed'}" .WriteLine " document.getElementById('BtnLayout').value = 'Enlarge cells with long names'}" .WriteLine " else{for (var i = 0; i < tn.length; i++) {tn[i].style.tableLayout = 'auto'}" .WriteLine " document.getElementById('BtnLayout').value = 'Shrink cells with long names'}" .WriteLine "}" .WriteLine "</script>" .WriteLine "<style type=""text/css"">" .WriteLine "table{ table-layout:fixed; width:100%; border-width:1px; border-style:solid;" .WriteLine " border-color:black; border-collapse:collapse; background-color:Beige; }"

.WriteLine "table.sum{ table-layout:auto; background:none; border-style:none; width:auto;}" .WriteLine "td.sum{ border-style:none; vertical-align:top; width:auto;}" .WriteLine "td, th{ height:20px; border-width:1px; border-style:solid;" .WriteLine " border-color:silver; width:33%; text-align:left; }" .WriteLine "td.Added{ width:25% }" .WriteLine ".vers{ font-family: System, Arial, sans-serif; color:green }" .WriteLine "body{ background-color:#FCF3DA }" .WriteLine "hr{ color:wheat }" .WriteLine "input#BtnLayout{ width:190px }" .WriteLine "</style>" .WriteLine "</head><body>" .WriteLine "<p style=""font-size:18px; color:GreenYellow; text-align:center"">" & MyTitle & "</p><p>" .WriteLine "Differences from " & Dates & "&nbsp;&nbsp;" '--- "Diff" doit rester en debut de ligne:debut des infos .WriteLine "--&nbsp;&nbsp;<a href=""Reports_Comment_Index.htm"">Open previous reports</a></p>" .WriteLine "<p>Comment: <i>" & MyComment & "</i></p>" '-------Ecrit le rsum----.WriteLine "<p>" .WriteLine "<table class=""sum"">" .WriteLine VbTab & "<tr><td class=""sum"" colspan=""4"">Summary:</td></tr>" .WriteLine VbTab & "</tr><tr>" .WriteLine VbTab & "</tr><tr>" .WriteLine VbTab & VbTab & "<td class=""sum""><b>Missing folders:</b></td><td class=""sum"">" & MissFolCount & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>" .WriteLine VbTab & VbTab & "<td class=""sum""><b>Missing files:</b></td><td class=""sum"">" & MissFileCount & "</td>" .WriteLine VbTab & "</tr><tr>" .WriteLine VbTab & VbTab & "<td class=""sum""><b>New folders:</b></td><td class=""sum"">" & AddFolCount & "</td>" .WriteLine VbTab & VbTab & "<td class=""sum""><b>New files:</b></td><td class=""sum"">" & AddFileCount & "</td>" .WriteLine VbTab & "</tr><tr>" .WriteLine VbTab & VbTab & "<td class=""sum"">&nbsp;</td><td class=""sum"">&nbsp;</td>" .WriteLine VbTab & VbTab & "<td class=""sum""><b>Modified files:</b></td><td class=""sum"">" & ModFileCount & "</td>" .WriteLine VbTab & "</tr>" .WriteLine "</table><br>" '-------Ecrit la dure de l'operation----.WriteLine "Scan duration: " & Round(Timer - time1, 1) & " seconds<br><br>" '--- "Scan" doit rester en debut de ligne: fin des infos '--------Ecrit ScanList et ExcludeList-----.WriteLine "<table class=""sum"">" .WriteLine VbTab & "<tr><td class=""sum"">Settings:</td></tr>" .WriteLine VbTab & "<tr>" .WriteLine VbTab & VbTab & "<td class=""sum"">" .WriteLine VbTab & VbTab & "<b>Folders scanned:&nbsp;&nbsp;&nbsp;&nbsp;</b><br>" .WriteLine VbTab & VbTab & "Root of Drive C<br>" .WriteLine Replace(ScanList, VbCrlf, "<br>" & VbCrlf & VbTab & VbTab) .WriteLine VbTab & VbTab & "</td><td class=""sum"">" .WriteLine VbTab & VbTab & "<p><b>Folders excluded:</b><br>" .WriteLine Replace(ExcludeList, VbCrlf, "<br>" & VbCrlf & VbTab & VbTab) .WriteLine VbTab & VbTab & "</td>" .WriteLine VbTab & "</tr>" .WriteLine "</table>"

.WriteLine "</p>" .WriteLine "<hr>" '-------Ecrit l'entete des tables----.WriteLine "<p style=""text-align:center"">" .WriteLine "<input id=""BtnLayout"" type=""button"" value=""Enlarge cells with long names"" onclick=""fixLayout()"">" .WriteLine "</p>" .WriteLine "" .WriteLine "<table>" .WriteLine "<tr><th width=""34%"">Name</th><th width=""33%"">Size (bytes)</th><th width=""33%"">Date</th></tr>" .WriteLine "</table>" '--------crit les rsultats avec les codes html----For i=0 To ubfl If InStr(fl(i), "-------------------")>0 Then '----exclu les listes vdes Group = Split(fl(i), "-------------------") .WriteLine "<hr>" If InStr(Group(0)," [")=0 Then FolPath = Replace(Group(0), VbCrlf, "") .WriteLine "<a target=""_blank"" href=""file:///" & Replace(Escape(Replace(Replace(FolPath,"\","/"),":","////")),"////",":") & """>" .WriteLine FolPath & "</a><br>" Else sl = Split(Group(0)," [") FolPath = Replace(sl(0), VbCrlf, "") .WriteLine "<a target=""_blank"" href=""file:///" & Replace(Escape(Replace(Replace(FolPath,"\","/"),":","////")),"////",":") & """>" .WriteLine FolPath & "</a>&nbsp;&nbsp;&nbsp;[" & sl(1) & "<br>" End If For j=1 To UBound(Group) If InStr(Group(j), "MODIFIED:")>0 Then n = "MODIFIED:" ElseIf InStr(Group(j), "MISSING:")>0 Then n = "MISSING:" ElseIf InStr(Group(j), "ADDED:")>0 Then n = "ADDED:" Else n = "" End If If n<>"" Then .WriteLine "<span style=""color:red"">" & n & "</span><br>" .WriteLine "<table>" sl=Split(Group(j), VbCrlf) ubsl=UBound(sl) Select Case n Case "MODIFIED:" For k=1 To ubsl If InStr(sl(k), "===>") >0 Then modi = Split(sl(k), "===>") SplitDatas modi(0) If NameA<>"" Then .WriteLine VbTab & "<tr><td>" & NameA & "</td><td>" & SizeA & "</td><td>" _ & DateA & "</td></tr>" VerA = GetVersion(FolPath & "\" & NameA) SplitDatas modi(1)

.WriteLine VbTab & "<tr><td>&rarr;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" _ & "<span class=""vers"">"& VerA & "</span>" _ & "</td><td>" & SizeA & "</td><td>" & DateA & "</td></tr>" .WriteLine VbTab & "<tr><td style=""height:8px"" colspan=""3""></td></tr>" End If End If Next Case "MISSING:" For k=1 To ubsl If sl(k)<>"" Then SplitDatas sl(k) If NameA<>"" Then .WriteLine VbTab & "<tr><td>" & NameA & "</td><td>" & SizeA & "</td><td>" _ & DateA & "</td></tr>" End If End If Next Case "ADDED:" For k=1 To ubsl If sl(k)<>"" Then SplitDatas sl(k) If NameA<>"" Then VerA = GetVersion(FolPath & "\" & NameA) .WriteLine VbTab & "<tr><td>" & NameA & "&nbsp;&nbsp;&nbsp;&nbsp;" _ & "<span class=""vers"">"& VerA & "</span>" _ & "</td><td>" & SizeA & "</td><td>" & DateA & "</td></tr>" End If End If Next End Select .WriteLine "</table>" .WriteLine "" End If Next .WriteLine "" End If Next .WriteLine "<p>This report was written using " & MyTitle & "</p>" .WriteLine "</body></html>" .Close End With '------Ecrit Reports Comment Index---If fso.FileExists("Reports_Comment_Index.htm") = False Then Set OutputFile = fso.CreateTextFile("Reports_Comment_Index.htm", True) With OutputFile .WriteLine "<html><head><title>SysFileChecker Reports Index</title>" .WriteLine "<style type=""text/css""> body{background-color:#FCF3DA;} hr{color:wheat} </style>" .WriteLine "</head><body>" .WriteLine "<p style=""color:#00FF00; font-size:18px; text-align:center"">"

.WriteLine "Installed Files Checker Reports Index" .WriteLine "</p>" .WriteLine "<hr>" .WriteLine "<a href=""" & SysCheckFile & """>" & SysCheckFile & "</a> " .WriteLine "<b>" & FormatDateTime(Date,VBLongDate) & "</b> - " & MyComment .WriteLine "<hr>" .Close End With MsgBox "Reports Comment Index created!" _ & VbCrlf & "Open or double-click ""Reports_Comment_Index.htm"" in the Installed Files Checker program folder" _ & VbCrlf & "to view the reports in your Internet browser.", 64, MyTitle Else Set OutputFile = fso.OpenTextFile("Reports_Comment_Index.htm", 8) With OutputFile .WriteLine "<a href=""" & SysCheckFile & """>" & SysCheckFile & "</a> " .WriteLine "<b>" & FormatDateTime(Date,VBLongDate) & "</b> - " & MyComment .WriteLine "<hr>" .Close End With End If '_______________________________________________________ '--------Message final------WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",8,"REG_SZ" If NoArgument = True Then If MsgBox("Checking completed:" _ & VbCrlf & MissFolCount & " missing folders" _ & VbCrlf & AddFolCount & " new folders" _ & VbCrlf & MissFileCount & " missing files" _ & VbCrlf & AddFileCount & " new files" _ & VbCrlf & ModFileCount & " modified files" _ & VbCrlf & "Duration: " & Duration & " seconds." _ & VbCrlf & "" _ & VbCrlf & "Results saved in " & SysCheckFile _ & VbCrlf & "See the results?", 4, MyTitle) = 6 Then WshShell.Run SysCheckFile,3,False End if End If '___________________fin du script principal__________________

'--------Fonctions---------Function GetName(t) iscolon = InStr(t,":") '--------W98----If os="W98" _ And iscolon >15 _ And Left(t,1)<>" " _ And Left(t,3)<>".. " _ And Left(t,2)<>". " _ And Left(t,19)<>"Total files listed:" Then GetName = UCase( LTrim(Mid(t, iscolon +4 )) ) '--------XP----ElseIf os="XP" _ And iscolon >9 _ And Left(t,1)<>" " _ And Right(t,3)<>" .." _

And Right(t,2)<>" ." Then Do Until InStr(t, " ")=0 t=Replace(t," "," ") Loop MyArray = Split(t," ") If UBound(MyArray) > 2 + IsPM Then GetName = UCase( Mid(t, InStr(t, MyArray(3 + IsPM)) ) ) Else GetName = "" End If Else GetName = "" End If End Function '--------Fonctions-------Function SplitDatas(t) Do Until InStr(t, " ")=0 t=Replace(t," "," ") Loop iscolon = InStr(t,":") MyArray = Split(t," ") SizeA = "" DateA = "" NameA = "" '--------W98----If os="W98" _ And iscolon >15 _ And Left(t,1)<>" " _ And Left(t,3)<>".. " _ And Left(t,2)<>". " _ And InStr(t, "Total files listed:")=0 _ And UBound(MyArray) =>4 Then '-----Cherche le nom--NameA = LTrim(Mid(t, iscolon +4 )) '----Cherche l'emplacement de la date (peux varier d'un fichier a l'autre)--For ima = 2 To UBound(MyArray) If InStr(MyArray(ima), ":")>0 Then DatePlace = ima Exit For End If Next DateA = Replace(MyArray(DatePlace -1) & " " & MyArray(DatePlace), ".", "/") '-----Cherche la Taille--If InStr(NameA, ".")>0 Then For ima = 2 To DatePlace -2 SizeA = SizeA & MyArray(ima) Next Else '---pas d'extention au fichier donc une colonne en moin! If InStr(t, "<DIR>")>0 Then SizeA = "[Folder]" Else For ima = 1 To DatePlace -2 SizeA = SizeA & MyArray(ima) Next End If End If '--------XP----ElseIf os="XP" _ And iscolon >9 _

And Left(t,1)<>" " _ And Right(t,3)<>" .." _ And Right(t,2)<>" ." _ And InStr(t, "Total files listed:")=0 _ And UBound(MyArray) > 2 + IsPM Then If InStr(MyArray(2 + IsPM),"<DIR>")>0 Then SizeA = "[Folder]" Else SizeA = MyArray(2 + IsPM) End If DateA = MyArray(0) & " " & MyArray(1) If IsPM=1 Then DateA = DateA & " " & MyArray(2) Else DateA = Replace(DateA, ".", "/") End If NameA = Mid(t, InStr(t, MyArray(3 + IsPM)) ) End If SizeA = Replace(Replace(SizeA, ",", ""),".", "") End Function '------Fin de la fonction---'-----------function--------Function GetVersion(t) If InStr(1, t, ".exe", 1)>0 _ Or InStr(1, t, ".dll", 1)>0 _ Or InStr(1, t, ".ocx", 1)>0 _ Or InStr(1, t, ".pdr", 1)>0 _ Or InStr(1, t, ".vxd", 1)>0 _ Or InStr(1, t, ".drv", 1)>0 _ Or InStr(1, t, ".cpl", 1)>0 _ Or InStr(1, t, ".ax" , 1)>0 _ Or InStr(1, t, ".acm", 1)>0 _ Or InStr(1, t, ".386", 1)>0 _ Or InStr(1, t, ".3gr", 1)>0 _ Or InStr(1, t, ".mod", 1)>0 _ Or InStr(1, t, ".olb", 1)>0 _ Or InStr(1, t, ".old", 1)>0 _ Or InStr(1, t, ".pci", 1)>0 _ Or InStr(1, t, ".rll", 1)>0 _ Or InStr(1, t, ".tsk", 1)>0 _ Or InStr(1, t, ".tsp", 1)>0 _ Or InStr(1, t, ".vbx", 1)>0 _ Or InStr(1, t, ".vwp", 1)>0 _ Or InStr(1, t, ".sfx", 1)>0 _ Or InStr(1, t, ".flt", 1)>0 _ Or InStr(1, t, ".tlb", 1)>0 _ Or InStr(1, t, ".wpc", 1)>0 _ Or InStr(1, t, ".cnv", 1)>0 _ Or InStr(1, t, ".mml", 1)>0 _ Or InStr(1, t, ".ocr", 1)>0 Then If fso.FileExists(t)=True Then GetVersion = fso.GetFileVersion(t) End If End If End Function '-----Fin de la fonction---------'-----------sort function--------Function ArraySort(ArrY)

'-----dossiers

If os="XP" Then Exit Function '-----dja tris End If ReDim TempArray(255) For Each Word in ArrY UCaseWord = UCase(Word) & " " TempArrayNum = Asc(Left(UCaseWord,1)) TempArray(TempArrayNum) = TempArray(TempArrayNum) & Word & VBCrlf Next For Each SmallList In TempArray If SmallList <>"" Then SmallArray = Split( SmallList ,VBCrlf) nUB = UBound(SmallArray) If InStr(SmallList, "~2")=0 Then InsertionSort SmallArray Else InsertionSortB SmallArray End If BigList = BigList & Join(SmallArray,VbCrlf) End If Next ArrY = Split(BigList,VbCrlf) End Function '-----------sort function--------Function InsertionSortB(arrX) Dim i, j, v, v2, w For i=1 To nUB v = arrX(i) v2 = v If InStr(v,"~")>0 Then v = LTrim(UCase(Mid( v, InStr(v,":") +4 ))) End If j=i w = arrX(j-1) If InStr(w,"~")>0 Then w = LTrim(UCase(Mid( w, InStr(w,":") +4 ))) End If Do While w > v arrX(j) = arrX(j-1) j=j-1 If j<=0 Then Exit Do End If w = arrX(j-1) If InStr(w,"~")>0 Then w = LTrim(UCase(Mid( w, InStr(w,":") +4 ))) End If Loop arrX(j) = v2 Next End Function '-----------sort function--------Function InsertionSort(arrX) Dim i, j, v For i=1 To nUB v=arrX(i) j=i Do While arrX(j-1) > v

arrX(j) = arrX(j-1) j=j-1 If j<=0 Then Exit Do End If Loop arrX(j) = v Next End Function '---------------------------------'------Fin des fonctions "sort"---'____________________________________ '--------------Fonction--------------Function FindLenWp j=0 ParentDir="" For i=0 To UBound(d)-1 If InStr(d(i),Chr(130))=0 Then ParentDir = ParentDir & d(i) & "\" Else Exit For End If Next j=i Lenwp = Len( d(j) ) i=0 For Each sf In fso.GetFolder(ParentDir).SubFolders If Len(sf.Name) = Lenwp Then i=i+1 gp = sf.Path d(j) = sf.Name End If Next If i=1 Then '---si il n'y a qu'un seul directory avec un nom de la mme longeur If j < UBound(d) Then wp = Join(d,"\") If InStr( wp, Chr(130))=0 Then gp=wp WrongPaths(h) = WrongPaths(h) & VbTab & gp gpFound = True Else d=Split(wp, "\") FindLenWp End If Else WrongPaths(h) = WrongPaths(h) & VbTab & gp gpFound = True End If End If End Function '---------------------'________Fin des fonctions pour crire le fichier bat_________ '_________________________________________________ '--------------------Fin du script---------------'Frederic Hage

'Free to use and distribute for private and non commercial and non professional purpose. 'This script is under copyright protection.

<HTML> <HEAD> <HTA:APPLICATION ID="checksys" APPLICATIONid="checksystem"> <meta id="VI60_defaultClientScript" content="VBScript"> <TITLE>Installed Files Checker 4.8</TITLE> <SCRIPT LANGUAGE="VBScript"> Public fso, FileNumber,cf, cf2, x, x2, y, z, SysCheckFile, iTimerID, MyComment, WshShell, ClockSpan1, ClockSpan2 Sub window_onLoad() Set fso = CreateObject("Scripting.fileSystemObject") Set WshShell = CreateObject("WScript.Shell") id("BtnShowDetails").disabled = True id("Comment").focus On Error Resume Next '------check for obsolete registry entries used in previous version (this can be deleted in future versions) r = WshShell.RegRead("HKLM\System\DingueVBS\CheckSystemHtml") If err.Number <>0 Then err.Clear Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",r,"REG_SZ" WshShell.RegDelete "HKLM\System\DingueVBS\CheckSystemHtml" x=x+1 End If v = WshShell.RegRead("HKLM\System\DingueVBS\WScriptVersion") If err.Number <>0 Then err.Clear Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\WScriptVersion",v,"REG_SZ" WshShell.RegDelete "HKLM\System\DingueVBS\WScriptVersion" x=x+1 End If r = WshShell.RegRead("HKLM\System\DingueVBS\FileCount") If err.Number <>0 Then err.Clear Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount",r,"REG_SZ" WshShell.RegDelete "HKLM\System\DingueVBS\FileCount" x=x+1 End If r = WshShell.RegRead("HKLM\System\DingueVBS\FileDone") If err.Number <>0 Then err.Clear Else WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileDone",r,"REG_SZ" WshShell.RegDelete "HKLM\System\DingueVBS\FileDone" x=x+1 End If r = WshShell.RegRead("HKLM\System\DingueVBS\SystemBackUp") If err.Number <>0 Then err.Clear Else

WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\SystemBackUp",r,"REG_SZ" WshShell.RegDelete "HKLM\System\DingueVBS\SystemBackUp" x=x+1 End If r= WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProramFiles Dir") '---old typing mistake ;-) If err.Number <>0 Then err.Clear Else WshShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProramFilesDir" x=x+1 End If If x>0 Then id("ProgBarText0").innerText = x & " obsolete DingueVBS regkeys deleted." End If '------check if registry entry is normal------r = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\CheckSystemHtml") If err.Number <>0 Then r=0 WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" err.Clear End If v = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\WScriptVersion") If err.Number <>0 Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\WScriptVersion",0,"REG_SZ" err.Clear End If On Error GoTo 0 If r<8 And r>0 Then If MsgBox("Either the program didn't terminate normaly last time" _ & VbCrlf & "or another instance of this program is running." _ & VbCrlf & "Click ""Retry"" if you are sure that the program is not running already." , 5+48, document.Title) = 4 Then '--retry WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" Else MsgBox "Action canceled", 0+48, document.Title window.close End if ElseIf r=-1 Then WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" id("ProgBarText0").innerText = "Waiting for you to start. Note: There was an error last time." End If ClockSpan1 = "<span style=""font-family:'Wingdings'; font-size:32px; color:green"">&#0" ClockSpan2 = "Checking folder: <span style=""font-family:'Times New Roman'""> " End Sub Sub Go '--------check for ScanList.txt-----If fso.FileExists("ifc.ini")=False Then MsgBox "Thanks for using Installed Files Checker!" _ & VbCrlf & "Please proceed with the configuration settings.",0+64,document.Title CreateObject("WScript.Shell").Run "ifc_config13.hta" , 1, False

window.close Exit Sub End If '-------check if scan already done--If id("EnterBug").value = "ok" And id("BtnHelp").value = "Help" Then If MsgBox("Scan already done during this session:" _ & VbCrlf & "Are you sure that you want to re-scan your system now?",1+32,document.Title)=2 Then Exit Sub Else id("EnterBug").value = "" id("Result").innerHTML = "Comment for the report: <br><input type=""text"" id=""Comment"" size=""100"">" End If End If id("BtnGo").disabled = True id("BtnExit").disabled = True '-----Prend le commentaire personel et l'ecrit dans un fichier temporaire----MyComment = Replace(id("Comment").value, """", "'") Set objOutputFile = fso.CreateTextFile("tempcomment.txt", True) objOutputFile.Write MyComment objOutputFile.Close id("Comment").disabled = True '------set filename------Dates=Now SysCheckFile = "SystemCheck_" & Right(Year(Dates),2) & Right( "0" & Month(Dates),2 ) & Right( "0" & Day(Dates),2 ) _ & "_" & Right( "0" & Hour(Dates),2) & Right( "0" & Minute(Dates),2 ) & Right( "0" & Second(Dates),2 ) & ".htm" '----launch main vbs script----WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ" WshShell.Run "checksystem48.vbs " & SysCheckFile , 1, False id("ProgBarText0").innerText = "Please wait..." id("ProgBarText01").innerText = "Please wait..." '----launch progress bar-----x=0 x2=0 z=0 cf2="?" cf="?" iTimerID = window.setInterval("Progress", 500) End Sub Sub Progress Select Case WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\CheckSystemHtml") Case -1 window.clearInterval(iTimerID) id("ProgBarText0").innerText = "<span style=""color:red"">ERROR! Operation canceled.</span>" Case 0 id("ProgBarText0").innerText = "Starting, please wait..." Case 1 If x>11 Then x=0 End If id("ProgBarText0").innerHTML = "Preparing batch file, please wait." & ClockSpan1 & x+183 & ";</span>"

x=x+1 Case 2 id("ProgBarText0").innerText = "Batch file started, please wait..." y = Round( WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\FileCount") /1000 , 0) x = Round( fso.GetFile("WINF_B.TXT").Size /1000, 0) d = Round( x / (y/80) +1 ,0) id("ProgBarText01").innerText = "Doing file lists: " & x & "/" & y & " Kb" If d<80 Then id("ProgBarToDo01").innerText = String(80-d, "_") & "|" id("ProgBarDone01").innerText = String(d, "_") Else id("ProgBarToDo01").innerText = "|" id("ProgBarDone01").innerText = String(80, "_") End If Case 3 If x>11 Then x=0 End If id("ProgBarToDo01").innerText = "" id("ProgBarDone01").innerText = String(80, "_") id("ProgBarText01").innerText = "File list: Done" id("ProgBarText0").innerHTML = "Checking invalid folder names, please wait." & ClockSpan1 & x+183 & ";</span>" x=x+1 Case 4 If x>11 Then x=0 End If id("ProgBarToDo01").innerText = "" id("ProgBarDone01").innerText = String(80, "_") id("ProgBarText01").innerText = "File list: Done" id("ProgBarText0").innerHTML = "<span style=""color:red"">Loading datas to memory, please wait.</span>" _ & ClockSpan1 & x+183 & ";</span>" x=x+1 Case 5 id("ProgBarToDo01").innerText = "" id("ProgBarDone01").innerText = String(80, "_") id("ProgBarText01").innerText = "File list: Done" id("ProgBarText0").innerText = "Loading datas to memory: Done. Checking folders..." y = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\FileCount") x = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\FileDone") d = Round( x / (y/80) +1 ,0) id("ProgBarText1").innerText = "Comparing file lists: " & x & "/" & y id("ProgBarDone1").innerText = String(d, "_") If d<80 Then id("ProgBarToDo1").innerText = String(80-d, "_") & "|" Else id("ProgBarToDo1").innerText = "|" End If cf = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\CheckingFolder") z=z+1 If z>11 Then z=0

End If id("ProgBarText0").innerHTML = ClockSpan2 & cf & ClockSpan1 & z+183 & ";</span>" Case 6 If x>11 Then x=0 End If id("ProgBarText0").innerHTML = "Checking existing folders: ok." id("ProgBarToDo1").innerText = "" id("ProgBarDone1").innerText = String(80, "_") id("ProgBarText1").innerText = "Comparing file lists: Done" id("ProgBarText2").innerHTML = "Checking for missing folders, please wait." & ClockSpan1 & x+183 & ";</span>" x=x+1 Case 7 If x>11 Then x=0 End If id("ProgBarText0").innerHTML = "Checking existing folders: ok." id("ProgBarToDo1").innerText = "" id("ProgBarDone1").innerText = String(80, "_") id("ProgBarText1").innerText = "Comparing file lists: Done" id("ProgBarText2").innerText = "Checking for missing folders: Done" id("ProgBarText3").innerHTML = "Writing report file, please wait. " & ClockSpan1 & x+183 & ";</span>" x=x+1 Case 8 window.clearInterval(iTimerID) id("EnterComment").innerHTML = "" id("ProgBarText0").innerHTML = "Checking existing folders: ok." id("ProgBarToDo1").innerText = "" id("ProgBarDone1").innerText = String(80, "_") id("ProgBarText1").innerText = "Comparing file lists: Done" id("ProgBarText2").innerText = "Checking for missing folders: Done" id("ProgBarText3").innerText = "Writing Html file: Done" id("BtnExit").disabled = False id("BtnShowDetails").disabled = False id("EnterBug").value = "ok" '----lit le rsultat dans le fichier html----x=0 If fso.FileExists(SysCheckFile)=True Then Set ts = fso.OpenTextFile(SysCheckFile, 1) Do Until Left(t,4)="Diff" If ts.AtEndOfStream Then MsgBox "Error loading results! (1)",0+16,document.Title Exit Sub Else t = ts.ReadLine End If Loop r = "<p>" & t & "</p>" ts.SkipLine r = r & ts.ReadLine & "<p>Results saved in <i>" & SysCheckFile & "</i></p>" Do Until Left(t,4)="Scan" If ts.AtEndOfStream Then MsgBox "Error loading results! (2)",0+16,document.Title

id("Result").innerHTML = r Exit Do Else t = ts.ReadLine r=r&t End If Loop ts.Close id("Result").innerHTML = r ElseIf x<3 Then MsgBox "Error loading results:" & VbCrlf & "Click ""Ok"" to try again.",0+48,document.Title Progress x=x+1 Else MsgBox "Error loading results!" & VbCrlf & SysCheckFile & " doesn't exist.",0+16,document.Title End If '-------agrandit la fenetre--'window.moveTo 0, 0 'window.ResizeTo window.screen.width ,window.screen.height -24 Case 9 window.clearInterval(iTimerID) id("ProgBarText0").innerText = "First time use: no result. Operation finished." id("ProgBarToDo01").innerText = "" id("ProgBarDone01").innerText = String(80, "_") id("ProgBarText01").innerText = "File list: Done" id("ProgBarToDo1").innerText = "" id("ProgBarDone1").innerText = String(80, "_") id("ProgBarText1").innerText = "Comparing file lists: Nothing to do" id("ProgBarText2").innerText = "Checking for missing folders: Nothing to do" id("ProgBarText3").innerText = "Writing Html file: Nothing to do" id("BtnExit").disabled = False id("EnterBug").value = "ok" End Select End Sub Sub ShowDetails id("BtnShowDetails").disabled = True If fso.FileExists(SysCheckFile)=False Then MsgBox "Error loading results!" & VbCrlf & SysCheckFile & " doesn't exist.",0+16,document.Title Exit Sub End If Set ts = fso.OpenTextFile(SysCheckFile, 1) Do Until Left(t,4)="Diff" If ts.AtEndOfStream Then MsgBox "Error loading results! Can't find ""Diff"".",0+16,document.Title Exit Sub Else t = ts.ReadLine End If Loop r = "<p>" & t & "</p>" ts.SkipLine r = r & ts.ReadLine & "<p>Results saved in <i>" & SysCheckFile & "</i></p>" id("Result").innerHTML = r & Replace(ts.ReadAll, "</body></html>", "") ts.Close window.moveTo 0, 0

window.ResizeTo window.screen.width ,window.screen.height -24 End Sub Sub ShowAbout Ins = 5 Version = Mid(document.Title, 24) Configured = "Not yet configured" DataSize = "?" IfcConfigVBS = "Not installed! The program won't work without this file" CheckSystemVBS = "Not installed! The program won't work without this file" HelpFile = "Not installed! No help available." On Error Resume Next Set Myfol = fso.getfolder(WshShell.CurrentDirectory) Set CurrentDir = Myfol.files WshVersion = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\WScriptVersion") If InStr(WshVersion, ".")>0 Then If WshVersion > Left(WshVersion, InStr(WshVersion, "."))*10 Then WshVersion = Replace(WshVersion, ".", ",") *1 End If End If If WshVersion=0 Or WshVersion="" Then WshVersion = "Unknown" ElseIf WshVersion < 5.6 Then MsgBox "WARNING: The version of Windows Script Host (WSH) installed on your computer is obsolete."_ & VbCrlf & "Your current WSH version is " & WshVersion _ & VbCrlf & "While the basic role of this program may be fulfilled, some functions could cause an error." _ & VbCrlf & "It's recommanded to install WSH 5.6.", 48, document.Title End If If Err.Number <>0 Then MsgBox "The program can't check its own installation."_ & VbCrlf & "Maybe because an obsolete WSH version is installed on this computer." _ & VbCrlf & "It's recommanded to install WSH 5.6.", 48, document.Title Exit Sub End If On Error GoTo 0 For Each File In CurrentDir Select Case LCase(File.name) Case "ifc.ini" Configured = "Configured" Case "winf_b.txt" DataSize = Round(File.size/1024,0) & " Kb" Case "ifc_config13.hta" IfcConfigVBS = "Installed" Ins = Ins-2 Case "checksystem48.vbs" CheckSystemVBS = "Installed" Ins = Ins-2 Case "readme.txt" HelpFile = "Installed" Ins = Ins-1 End Select Next If Ins>1 Then Ins = 48 Msg = VbCrlf & "WARNING: some files not found! Please check the list below and reinstall these files." & VbCrlf ElseIf Ins=1 Then Ins = 64 Msg = VbCrlf & "WARNING: Help file missing." & VbCrlf Else Ins = 64 Msg = VbCrlf & "Installation:" & VbTab & "OK"

End If MsgBox "Installed Files Checker" _ & VbCrlf & "Version:" & VbTab & VbTab & Version _ & VbCrlf & "Windows Script Host version:" & VbTab & Replace(WshVersion, ",", ".") _ & VbCrlf & "Author:" & VbTab & VbTab & "Fredledingue" _ & VbCrlf & "Date:" & VbTab & VbTab & "June 2011" _ & VbCrlf & Msg _ & VbCrlf & "Status:" & VbTab & VbTab & Configured _ & VbCrlf & "Datas size to verify:" & VbTab & DataSize _ & VbCrlf _ & VbCrlf & """ifc_config13.hta"":" & VbTab & VbTab & IfcConfigVBS _ & VbCrlf & """checksystem48.vbs"":" & VbTab & CheckSystemVBS _ & VbCrlf & """readme.txt"":" & VbTab & VbTab & HelpFile ,0+Ins,document.Title End Sub Sub ShowHelp If id("BtnHelp").value = "Help" Then If Fso.FileExists("readme.txt")=True Then Set ts = fso.OpenTextFile("readme.txt", 1) id("Result").innerHTML = "<br>" & Replace( Replace( ts.ReadAll, "----------", "<hr>"), VbCrlf, "<br>") ts.Close id("BtnHelp").value = "Close Help" Else MsgBox "Help file (readme.txt) not found",,document.Title & " ERROR" End If Else id("Result").innerHTML = "" id("BtnHelp").value = "Help" End If End Sub Sub ShowArchives WshShell.Run "IEXPLORE.EXE " & WshShell.CurrentDirectory & "/Reports_Comment_Index.htm" , 1, False End Sub Sub Setings WshShell.Run "ifc_config13.hta" window.close End Sub Function id(o) Set id = document.getElementById(o) End Function </script> <script type="text/javascript"> function fixLayout() {var tn = document.body.getElementsByTagName('table') if (tn[0].style.tableLayout == 'auto') {for (var i = 0; i < tn.length; i++) {tn[i].style.tableLayout = 'fixed'} document.getElementById('BtnLayout').value = 'Enlarge cells with long names'} else{for (var i = 0; i < tn.length; i++) {tn[i].style.tableLayout = 'auto'} document.getElementById('BtnLayout').value = 'Shrink cells with long names'} } </script>

<style type="text/css"> table{ table-layout:fixed; width:100%; border-width:1px; border-style:solid; border-color:black; border-collapse:collapse; background-color:beige } table.summary{ border:none; background-color:#FCF3DA } table.sum{ table-layout:auto; background:none; border-style:none; width:auto } td.sum{ border-style:none; vertical-align:top; width:auto } td, th{ height:20px; border-width:1px; border-style:solid; border-color:silver; width:33%; text-align:left } td.Added{ width:25% } hr{ color:wheat } body{ background-color:AntiqueWhite; scrollbar-face-color: wheat; scrollbar-shadow-color:brown; scrollbar-track-color:beige; scrollbar-darkshadow-color:black } .pbToDo{ background-color:silver; color:white } .pbDone{ background-color:DeepSkyBlue} input#BtnGo { width:190px } input#BtnLayout { width:190px } input#BtnShowDetails { width:90px } input#BtnArch { width:100px } input.button{ background-color:wheat; font-size: 12px; font-family: Verdana, Arial, sans-serif; border-color:brown; border-width:2px; border-style:outset } .form{ font-family: System, Arial, sans-serif } .vers{ font-family: System, Arial, sans-serif; color:green } #Result{ font-family:'Times New Roman'} </style> </head> <body> <div class="form"> <input id="BtnGo" type="button" value="Check Installed System Files!" onclick="Go"> <input id="BtnShowDetails" type="button" value="Show Details" onclick="ShowDetails"> <input id="BtnExit" type="button" value="Exit" onclick="window.close"> <input id="BtnHelp" type="button" value="Help" onclick="ShowHelp"> <input id="BtnAbout" type="button" value="About" onclick="ShowAbout"> <input id="BtnArch" type="button" value="Show Archives" onclick="ShowArchives"> <input id="BtnSetings" type="button" value="Setings" onclick="Setings"><br> <span id="EnterComment">Enter a comment for the report: <input type="text" id="Comment" size="100"></span><br> </div> <hr> <div id="Result"></div> <div class="form"> <ul type="square"> <li><span id="ProgBarText0">Waiting for you to start...</span><br></li> <li><span id="ProgBarText01">Doing file lists...</span><br> <span class="pbDone" id="ProgBarDone01"></span> <span class="pbToDo" id="ProgBarToDo01"> ______________________________________________________________________ _______|</span><br> </li>

<li><span id="ProgBarText1">Comparing file lists...</span><br> <span class="pbDone" id="ProgBarDone1"></span> <span class="pbToDo" id="ProgBarToDo1"> ______________________________________________________________________ _______|</span><br> </li> <li><span id="ProgBarText2">Checking for missing folders...</span><br></li> <li><span id="ProgBarText3">Writing report file...</span></li> </ul> <input type="text" id="EnterBug" size="2" value=""> </div> </body> </html> <!--Frdric Hage --> <!--Free to use and distribute for private and non commercial and non professional purpose. --> <!--This script is under copyright protection. -->

<html> <head> <HTA:APPLICATION ID=setHTA WINDOWSTATE="maximize"> <title>IFC Settings</title> </head> <script language="VBScript"> Public fso, WshShell Public ScanList, ExcludeList Sub window_onLoad() Set fso = CreateObject("Scripting.fileSystemObject") Set WshShell = CreateObject("WScript.Shell") '-------Root C: rien faire, slectionn par dfault--document.form.OptRootC.checked = True document.form.OptRootC.disabled = True '-------cherche windows ---WindowsFolder = fso.GetFolder(WshShell.ExpandEnvironmentStrings("%windir%")) document.all.WPath.innerText = WindowsFolder document.form.OptWPath.checked = True ScanList = WindowsFolder & VbCrlf '-------cherche windows\temp---f=WindowsFolder & "\Temp" If fso.FolderExists(f) Then document.all.WTempPath.innerText = f document.form.OptWTempPath.checked = True ExcludeList = ExcludeList & f & VbCrlf Else document.form.OptWTempPath.disabled = True End If '-------cherche windows\...Office\Recent---f=WindowsFolder & WindowsFolder & "\Application Data\Microsoft\Office\Recent" If fso.FolderExists(f) Then document.all.WOfficeRecentPath.innerText = f document.form.OptWOfficeRecentPath.checked = True

ExcludeList = ExcludeList & f & VbCrlf Else document.form.OptWOfficeRecentPath.disabled = True End If '--------Exclude OE------FolderFound = False f=WindowsFolder & "\Application Data\Identities" If fso.FolderExists(f) Then For Each subfolder in fso.getfolder(f).subfolders f=subfolder.path & "\Microsoft\Outlook Express" If fso.FolderExists(f) Then document.all.OEPath.innerText = f document.form.OptOEPath.checked = True FolderFound = True ExcludeList = ExcludeList & f & VbCrlf Exit For End If Next End If If FolderFound = False Then document.form.OptOEPath.disabled = True End If '---------chercher programme files---FolderFound = False On Error Resume Next f = WshShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFiles Dir") If Err.Number<>0 Then Err.Clear f="" End If On Error GoTo 0 If Fso.FolderExists(f)=True Then FolderFound = True Else Set DriveC = fso.GetFolder("C:\") For Each folder In DriveC.subfolders n=folder.path If Fso.FolderExists(n & "\Accessories") _ Or Fso.FolderExists(n & "\Internet Explorer") _ Or Fso.FolderExists(n & "\Microsoft Office") _ Or Fso.FolderExists(n & "\Windows Media Player") _ Or Fso.FolderExists(n & "\DirectX") _ Then f=n WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFiles Dir", f,"REG_SZ" FolderFound = True Exit For End If Next End If If FolderFound = False Then document.form.OptProgramFilesPath.disabled = True document.form.BtnBrowse2.disabled = True Else ProgFilesFolder=f document.all.ProgramFilesPath.innerText = f

document.form.OptProgramFilesPath.checked = True ScanList = ScanList & f & VbCrlf End If '----cherche Cookies----Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(&H21&) f = objFolder.Items.Item.path document.all.CookiesPath.innerText = f If CheckAndExclude(f, 0) = True Then document.form.OptCookiesPath.checked = True ExcludeList = ExcludeList & f & VbCrlf End If '----cherche Recent----Set objFolder = objShell.Namespace(&H8&) f = objFolder.Items.Item.path document.all.WRecentPath.innerText = f If CheckAndExclude(f, 0) = True Then document.form.OptWRecentPath.checked = True ExcludeList = ExcludeList & f & VbCrlf End If '-----cherche Temp systme--Set wshShell = Createobject("WScript.Shell") Set wshSysEnv = wshShell.Environment f = wshSysEnv("TEMP") document.all.VTempPath.innerText = f If CheckAndExclude(f, 0) = True Then document.form.OptVTempPath.checked = True ExcludeList = ExcludeList & f & VbCrlf End If '----cherche internet tempf= WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersio n\Explorer\Shell Folders\Cache") document.all.Cache.innerText = f If CheckAndExclude(f, 0) = True Then document.form.OptCache.checked = True ExcludeList = ExcludeList & f & VbCrlf End If '----cherche dossier d'installation de ifcOn Error Resume Next f = WshShell.CurrentDirectory If Err.Number <>0 Then MsgBox "WARNING: The version of Windows Script Host (WSH) installed on your computer is obsolete."_ & VbCrlf & "While the basic role of this program may be fulfilled, some functions could cause an error"_ & VbCrlf & "and the program will be slower." _ & VbCrlf & "It's recommanded to install WSH 5.6 or higher.", 48, document.Title If MsgBox("It's recommanded to exclude the folder where you installed Installed File Checker"_ & VbCrlf & "because every new reports and log changes will be reported and this is not very useful."_ & VbCrlf & "Click ""OK"" to manualy find and select this folder."_ & VbCrlf & "Click ""Cancel"" if you want to scan this folder anyway.", vbOk, document.Title) = vbOk Then Set objFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Select the folder where you installed Installed File Checker", 0, 36) If objFolder Is Nothing Then f=""

Else f = objFolder.Items.Item.path End If Set objFolder = Nothing Else f="" End if End If On Error GoTo 0 document.all.IfcFolder.innerText = f If CheckAndExclude(f, 0) = True Then document.form.OptIfcFolder.checked = True ExcludeList = ExcludeList & f & VbCrlf End If '----dactive le boutton BtnStartIfc---'document.form.BtnStartIfc.disabled = True '---Lit previous settings dans ifc.ini si il existe------If fso.FileExists("ifc.ini")=True Then Set ts = fso.GetFile("ifc.ini").OpenAsTextStream(1) Do Until InStr(t, "Root of Drive ") >0 t=ts.ReadLine Loop t=ts.ReadLine Do Until InStr(t, "[Folders excluded]") >0 If t<>"" Then If InStr(1, ScanList, t & VbCrlf ,1)=0 Then ScanBox = ScanBox & t & VbCrlf End If End If t=ts.ReadLine Loop t=ts.ReadLine Do Until InStr(t, "[Settings]") >0 If t<>"" Then If InStr(1, ExcludeList, t & VbCrlf ,1)=0 Then ExcludeBox = ExcludeBox & t & VbCrlf End If End If t=ts.ReadLine Loop ts.Close End If document.form.PersExcludeList.innerText = ExcludeBox document.form.PersScanList.innerText = ScanBox ScanList="" ExcludeList="" End Sub Sub Save '------prend les otpions---ScanList = "" ExcludeList = "" If document.form.OptWPath.checked = True Then ScanList = document.all.WPath.innerText & VbCrlf End If If document.form.OptProgramFilesPath.checked = True Then ScanList = ScanList & document.all.ProgramFilesPath.innerText & VbCrlf End If '------prend les dossiers personaliss----MyList = document.form.PersScanList.innerText '& VbCrlf

If Len(MyList)>4 Then l=Split(MyList, VbCrlf) sl0 = Split(ScanList, VbCrlf)(0) sl1 = Split(ScanList, VbCrlf)(1) For i=0 To UBound(l) If Len(l(i))>3 Then If fso.FolderExists(l(i))=True Then If InStr(1, l(i), sl0, 1)=1 _ Or InStr(1, l(i), sl1, 1)=1 _ Or InStr(1, l(i), fso.GetFolder(sl0).ShortPath, 1)=1 _ Or InStr(1, l(i), fso.GetFolder(sl1).ShortPath, 1)=1 Then If MsgBox("This is a subfolder of a folder that will be already scanned." _ & VbCrlf & "It's not necessary to add this folder to the scan list" _ & VbCrlf & "UNLESS it belongs to a folder which is in the exclude list" _ & VbCrlf & "and you still want to scan this subfolder." _ & VbCrlf _ & VbCrlf & "Keep this subfolder in the scan list?" _ & VbCrlf & l(i), 4+48, document.Title)=6 Then ScanList = ScanList & l(i) & VbCrlf End If Else ScanList = ScanList & l(i) & VbCrlf End If Else MsgBox "Folder to scan not found." _ & VbCrlf & "This folder will not be scanned:" _ & VbCrlf & l(i), 0+48, document.Title End If End If Next End If If Len(ScanList)<3 Then MsgBox "Scan List empty: Nothing to do.",,document.Title Exit Sub Else document.form.PersScanList.innerText = ScanList End If '-----Prend les otpions d'exclusion----If document.form.OptWTempPath.checked = True Then ExcludeList = document.all.WTempPath.innerText & VbCrlf End If If document.form.OptVTempPath.checked = True Then ExcludeList = ExcludeList & document.all.VTempPath.innerText & VbCrlf End If If document.form.OptWRecentPath.checked = True Then ExcludeList = ExcludeList & document.all.WRecentPath.innerText & VbCrlf End If If document.form.OptWOfficeRecentPath.checked = True Then ExcludeList = ExcludeList & document.all.WOfficeRecentPath.innerText & VbCrlf End If If document.form.OptOEPath.checked = True Then ExcludeList = ExcludeList & document.all.OEPath.innerText & VbCrlf End If

If document.form.OptCookiesPath.checked = True Then ExcludeList = ExcludeList & document.all.CookiesPath.innerText & VbCrlf End If If document.form.OptCache.checked = True Then ExcludeList = ExcludeList & document.all.Cache.innerText & VbCrlf End If If document.form.OptIfcFolder.checked = True Then ExcludeList = ExcludeList & document.all.IfcFolder.innerText & VbCrlf End If '-----Prend les dossiers exclus personaliss----MyList = document.form.PersExcludeList.innerText If Len(MyList)>3 Then l=Split(MyList, VbCrlf) For i=0 To UBound(l) If CheckAndExclude(l(i), 1)=True Then '----function ExcludeList = ExcludeList & l(i) & VbCrlf End If Next End If document.form.PersExcludeList.innerText = ExcludeList '-----Ecrit le fichier ini-----Set obIniFile = fso.CreateTextFile("ifc.ini", True) obIniFile.WriteLine "[Scan List]" obIniFile.WriteLine "Root of Drive C" obIniFile.WriteLine ScanList obIniFile.WriteLine "[Folders excluded]" obIniFile.WriteLine ExcludeList obIniFile.WriteLine "[Settings]" obIniFile.WriteLine "no special setting" '------ok------MsgBox "Settings saved!",,document.title 'document.form.BtnStartIfc.disabled = False End Sub Sub BrowseForFolder(var,PathNum) Select Case var Case 1 Msg = "Choose the folder you want to scan" Case 2 Msg = "Choose the folder you want to exclude" End Select Select Case PathNum Case 0 HeadFolder = "My Computer" '---ou 36 Case 1 HeadFolder = document.all.WPath.innerText Case 2 HeadFolder = document.all.ProgramFilesPath.innerText End select Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder(0, Msg, 0, HeadFolder) If objFolder Is Nothing Then MsgBox "no folder selected" Else Select Case var Case 1 t = document.form.PersScanList.innerText If t="" Then document.form.PersScanList.innerText = objFolder.Items.Item.path Else document.form.PersScanList.innerText = t & VbCrlf & objFolder.Items.Item.path End If Case 2

t = document.form.PersExcludeList.innerText f = objFolder.Items.Item.path If CheckAndExclude(f, 1) = True Then If t="" Then document.form.PersExcludeList.innerText = f Else document.form.PersExcludeList.innerText = t & VbCrlf & f End If End If End Select End If Set objFolder = Nothing End Sub Sub ShowHelp MsgBox "***** HELP ******" _ & VbCrlf & "1/ Long and short paths are both valid." _ & VbCrlf & "2/ Folders to scan must exist at the time of setting." _ & VbCrlf & "3/ Folders to exclude don't have to exist at the time of setting." _ & VbCrlf & "4/ The program autodetect recommanded folders. You can choose to unselect them if you want." _ & VbCrlf & "5/ Non-selected folders don't have to be in the exclude list." _ & VbCrlf & "6/ ""Root C"" means that the files, not the folders, in ""C:\"" will be compared. This is not optionable." _ & VbCrlf & "7/ Subfolders from each selected/excluded folder will be checked/excluded." _ & VbCrlf & "8/ Wild cards (*) not supported." _ & VbCrlf _ & VbCrlf & "***** INFO ******" _ & VbCrlf & "Author: Fredledingue" _ & VbCrlf & "Date: June 2009",,document.title End Sub Sub StartIfc CreateObject("WScript.Shell").Run "checksystem48.hta" , 1, False window.close End Sub Function CheckAndExclude(MyPath, ShowMsg) CheckAndExclude = False If Len(MyPath)>3 Then If fso.FolderExists(MyPath)=True Then sl = Split(ScanList, VbCrlf) FolderFound = False For j=0 To UBound(sl)-1 If InStr(1, MyPath, sl(j), 1)=1 Or InStr(1, MyPath, fso.GetFolder(sl(j)).ShortPath, 1)=1 Then FolderFound = True Exit For End if Next If FolderFound = False Then If ShowMsg = 1 Then MsgBox "This is not a subfolder of a folder that will be scanned." _ & VbCrlf & "It's not necessary to keep this folder in the exclude list:" _ & VbCrlf & MyPath, 0+48, document.Title

End If Else CheckAndExclude = True End If Else If ShowMsg = 1 Then If MsgBox("Folder to exclude not found:" _ & VbCrlf & MyPath _ & VbCrlf & "Keep this folder in the exclude list?", 4+48, document.Title)=6 Then CheckAndExclude = True End If End If End If End If End Function

</script> <body bgcolor="#FFC993"> <p align="center"><font size="5" color="#009900">Installed Files Checker Settings</font><br> If you don't know what to do, just press the Save Settings button. </p> <FORM NAME="form"> <p align="left"> <font color="#009900">Scan</font><br> <INPUT type="checkbox" name="OptRootC"><span id="RootC"></span>Root of drive C<br> <INPUT type="checkbox" name="OptWPath"><span id="WPath"></span><br> <INPUT type="checkbox" name="OptProgramFilesPath"><span id="ProgramFilesPath"></span><br> <BR> <font color="#009900">Scan more folders :</font> <INPUT NAME="BtnBrowse" ONCLICK="BrowseForFolder 1,0" TYPE="BUTTON" VALUE="Browse for a folder to scan"> <BR> <textarea name="PersScanList" cols="60" rows="4"></textarea><BR> <br> <font color="#009900">Exclude</font><br> <INPUT type="checkbox" name="OptWTempPath"><span id="WTempPath"></span><br> <INPUT type="checkbox" name="OptVTempPath"><span id="VTempPath"></span><br> <INPUT type="checkbox" name="OptWRecentPath"><span id="WRecentPath"></span><br> <INPUT type="checkbox" name="OptWOfficeRecentPath"><span id="WOfficeRecentPath"></span><br> <INPUT type="checkbox" name="OptOEPath"><span id="OEPath"></span><br> <INPUT type="checkbox" name="OptCookiesPath"><span id="CookiesPath"></span><br> <INPUT type="checkbox" name="OptCache"><span id="Cache"></span><br> <INPUT type="checkbox" name="OptIfcFolder"><span id="IfcFolder"></span><br> <BR> <font color="#009900">Exclude more folders from:</font> <INPUT NAME="BtnBrowse1" ONCLICK="BrowseForFolder 2,1" TYPE="BUTTON" VALUE="Windows folder"> <INPUT NAME="BtnBrowse2" ONCLICK="BrowseForFolder 2,2" TYPE="BUTTON" VALUE="Program Files folder"> <INPUT NAME="BtnBrowse3" ONCLICK="BrowseForFolder 2,0" TYPE="BUTTON" VALUE="Another folder">

<BR> <textarea name="PersExcludeList" cols="60" rows="6"></textarea><BR> <br> </p> <p align="center"> <INPUT NAME="BtnSave" ONCLICK="Save" TYPE="BUTTON" VALUE="Save settings"> <INPUT NAME="BtnStartIfc" ONCLICK="StartIfc" TYPE="BUTTON" VALUE="Start System Files Checker"> <INPUT NAME="BtnHelp" ONCLICK="ShowHelp" TYPE="BUTTON" VALUE="Help"> <INPUT NAME="BtnExit" ONCLICK="window.close" TYPE="BUTTON" VALUE="Exit"> </p> </FORM> <span id="Help"></span> </body> </html>

Das könnte Ihnen auch gefallen