codigo fuente

Upload: mauricio-rojas-valdivia

Post on 30-Oct-2015

57 views

Category:

Documents


0 download

TRANSCRIPT

Codigo FuenteSystem 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 fsoSet 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 ThenSysCheckFile = ""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 ThenMsgBox "Action canceled",,MyTitleWScript.QuitEnd ifMyComment = InputBox("Enter your comment for the report", MyTitle,, 520, 340)NoArgument = TrueElseIf Len(WScript.Arguments(0)) < 10 ThenMsgBox "Invalid argument, action canceled.",0+16, MyTitle & " - ERROR"WScript.CreateObject("WScript.Shell").RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",-1,"REG_SZ"WScript.QuitElseNoArgument = FalseSysCheckFile = WScript.Arguments(0)'-------Lit le commentaire------Wscript.Sleep 300If fso.FileExists("tempcomment.txt")=True ThenSet f = fso.GetFile("tempcomment.txt")If f.size > 1 ThenSet ts = f.OpenAsTextStream(1)MyComment = ts.ReadAllts.CloseElseMyComment = "(no comment)"End IfEnd IfEnd If'--------Set constants------Dim nUB,OutputFile,BatFile,ExcludeList,ErrorList,SizeA,DateA,VerA,ParentDirDim NameA,NameB,TempListA,TempListB,EstPlace,EstPlace2,FolPath,FolFound,FileFound,LoopCountDim 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,IsPMSet WshShell = WScript.CreateObject("WScript.Shell")'--------Configuration-----If fso.FileExists("ifc.ini")=False ThenIf NoArgument = True ThenMsgBox "Thanks for using Installed Files Checker!" _& VbCrlf & "Click ""OK"" to proceed with the configuration settings.",0+64,MyTitleWshShell.Run "ifc_config13.hta",1,TrueEnd IfEnd If'------check registry-----On Error Resume Nextr = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\CheckSystemHtml")If err.Number 0 Thenr=0WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ"err.ClearEnd Ifv = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\WScriptVersion")If err.Number 0 Or v=0 Or v="" ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\WScriptVersion",WScript.Version,"REG_SZ"err.ClearEnd IfOn Error GoTo 0If r0 ThenIf 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 '--retryWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ"ElseMsgBox "Action canceled", 0+48, MyTitleWScript.QuitEnd ifElseIf r=-1 ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ"End If

'-------time debug-------time1=Timer'--------Cre le nom d fichier-------Dates = NowIf SysCheckFile = "" ThenSysCheckFile = "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 Thenfso.GetFile("WINF_A.TXT").Deletefso.GetFile("WINF_B.TXT").Move "WINF_A.TXT" '------A = vieille liste, B = nouvelle listeEnd 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 ThenSet OutputFile = fso.CreateTextFile("InvalidPathsIndex.txt", True)OutputFile.WriteLine ""OutputFile.CloseEnd If'---------prend la taille de ifc.bat--------If fso.FileExists("ifc.bat")=True ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", fso.GetFile("ifc.bat").Size ,"REG_SZ"ElseWshShell.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 ") >0t=ts.ReadLineLoopt=ts.ReadLineDo Until InStr(t, "[Folders excluded]") >0If t"" ThenScanList = t & VbCrlf & ScanListEnd Ift = RTrim( LTrim( Replace(ts.ReadLine, VbTab, "") ) )Loopt=ts.ReadLineDo Until InStr(t, "[Settings]") >0If t"" ThenExcludeList = t & VbCrlf & ExcludeListEnd Ift = RTrim( LTrim( Replace(ts.ReadLine, VbTab, "") ) )Loopts.Close'------DebugSet 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 DatesOutputFile.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 ThenIf fso.FolderExists(FolderToDo) = True Then'--------prcdament: Function DoSearch---'FolderToDo = fso.GetFolder(FolderToDo).ShortPath'------crit batch temporaire et le lance----fso.CreateTextFile "tempdir.txt", TrueWith 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".CloseEnd WithWshShell.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 NextLongPath = ts.ReadLineDo Until ts.AtEndOfStreamp = fso.GetFolder(LongPath).ShortPathFolFound = FalseIf err.Number>0 ThenErr.ClearFor Each Excl In ExclArrayIf Excl"" ThenIf InStr(1, LongPath, Excl, 1)=1 ThenFolFound = TrueExit ForEnd IfEnd IfNextIf FolFound = False ThenErrorList = LongPath & VbCrlf & ErrorListEnd IfElseFor Each Excl In ExclArrayIf Excl"" ThenIf InStr(1, LongPath, Excl, 1)=1 Or InStr(1, p, Excl, 1)=1 ThenFolFound = TrueExit ForEnd IfEnd IfNextIf FolFound = False ThenBatFile.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 IfEnd IfLongPath = ts.ReadLineLoopOn Error GoTo 0End IfEnd IfNext'------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.CloseWrongPaths = Split(ErrorList, VbCrlf)For h=0 To UBound(WrongPaths)wp = WrongPaths(h)If Len(wp) > 3 ThengpFound = False'------cherche dans wpIndex------For i=0 To ubwpiIf Instr(wpIndex(i), wp)=1 And InStr(wpIndex(i), VbTab)>0 ThenWrongPaths(h) = wpIndex(i)gpFound = TrueEnd IfNext'-------cherche d'aprs la longuer du nom-----If gpFound = False Thenwp2=""For i=1 To Len(wp)c=Asc(Mid(wp,i,1))If c126 Thenwp2 = wp2 & Chr(130)Elsewp2 = wp2 & Mid(wp,i,1)End IfNextwp=wp2d=Split(wp, "\")FindLenWpEnd If'-------cherche en remplacant le mauvais caractre---If gpFound = False ThenFor i=128 To 255gp = Replace(wp, Chr(130), Chr(i))If fso.FolderExists(gp)=True ThenWrongPaths(h) = WrongPaths(h) & VbTab & gpgpFound = TrueExit ForEnd IfNextEnd If'-------cherche en remplacant le mauvais caractre si il y en a deux---If gpFound = False Thenwpa = Split(wp, Chr(130) )ubwpa = UBound(wpa)If ubwpa=2 ThenFor i=128 To 255For j=128 To 255gp = wpa(0) & Chr(i) & wpa(1) & Chr(j) & wpa(2)If fso.FolderExists(gp)=True ThenWrongPaths(h) = WrongPaths(h) & VbTab & gpgpFound = TrueExit ForEnd IfNextNextEnd IfEnd If'-----------demande de chercher manuellement si introuvable--------If gpFound = False Thenwpa = Split(wp,"\")ubwpa = UBound(wpa)wp2 = wpa(ubwpa-1) & "\" & wpa(ubwpa)ParentName = fso.GetFolder(ParentDir).Namewp2 = Mid(wp, InStr(wp,ParentName) + Len(ParentName)+1 )If Len(wp2)>50 Thenwp2 = "..." & Right(wp2,50)End IfSet objFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Please find:" & VbCrlf & wp2, 0, ParentDir)If objFolder Is Nothing ThenMsgBox "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,MyTitleElsegp = objFolder.Items.Item.pathWrongPaths(h) = WrongPaths(h) & VbTab & gpEnd IfSet objFolder = NothingEnd IfEnd IfNext'------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 ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileCount", fso.GetFile("WINF_A.TXT").Size ,"REG_SZ"ElseWshShell.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,TrueWshShell.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 OutputFileFor Each wp In WrongPathsIf InStr(wp, VbTab)>0 Thengp = Mid(wp, InStr(wp, VbTab)+1)Set folder = fso.GetFolder(gp)For Each Excl In ExclArrayIf Excl"" ThenIf InStr(1, gp, Excl, 1)=1 Or InStr(1, folder.ShortPath, Excl, 1)=1 ThenFolFound = TrueExit ForEnd IfEnd IfNextIf FolFound = False Then.WriteLine "".WriteLine " Directory of " & folder.Path.WriteLine "".WriteLine ".. " '----Attention: guarder l'espace blanc aprs les deux pointsFor Each file In folder.Files.WriteLine "XXX XXX " _& FormatNumber(file.size,0,0,0,-1) & " " _& file.DateLastModified & " " _& file.nameNextEnd IfEnd IfNext.CloseEnd With'-----------premire fois------If fso.FileExists("WINF_A.TXT")=False Thenfso.CreateTextFile("WINF_A.TXT") '------cre "WINF_A.TXT" une premire foisWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",9,"REG_SZ"'------Ecrit Reports Comment Index----If fso.FileExists("Reports_Comment_Index.htm") = False ThenSet OutputFile = fso.CreateTextFile("Reports_Comment_Index.htm", True)With OutputFile.WriteLine "SysFileChecker Reports Index".WriteLine "".WriteLine "Installed Files Checker Reports Index".WriteLine "".WriteLine "".WriteLine "Initial list of files created on " & FormatDateTime(Date,VBLongDate).WriteLine "".CloseEnd WithMsgBox "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, MyTitleEnd If'--------MsgBox "First time use: No change. Please run this program again whenever you want.", 0+64, MyTitleWscript.QuitEnd 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, "..")>0t=ts.ReadLineLoopIf InStr(t, ".. ")>0 Thenos="W98"ElseIf InStr(t, " ..")>0 Thenos="XP"'------Vrifie la maniere dont l'heure est ecrite------Do Until InStr(t, "")>0t=ts.ReadLineLoopDo Until InStr(t, " ")=0t=Replace(t," "," ")Loopt = Split( UCase(t), " ")(2)If t="PM" Or t="AM" ThenIsPM = 1ElseIsPM = 0End IfElseWshShell.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.QuitEnd 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.CloseSet 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=50a=0i=0'---------Create Index of folders------For i=0 To ublaisvc = InStr(ListA(i), VbCrlf)-1If isvc > 1 ThenFolindex(i) = Left(ListA(i),isvc)ElseFolindex(i) = ""End IfNexti=0'-------Scan ListB-------EstPlace=1AddFolCount=0ModFileCount=0MissFileCount=0MissFolCount=0AddFileCount=0z=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 ublbl = ListB(h)isvc = InStr(l, VbCrlf)-1If isvc > 1 ThenReDim Added(50)ubad=50ad=0ReDim Missing(50)ubmi=50mi=0ReDim Modified(50)ubmo=50mo=0'-------NOUVEAU---Donne le nom de ce directory ----FolPath = Left(l,isvc)'----debug----'DebugFile.Write FolPath'debugtime1 = Timer'---------If Len(Folpath)>50 ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckingFolder", Left(Folpath, 24) & "..." & Right(Folpath, 24),"REG_SZ"ElseWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckingFolder", Folpath,"REG_SZ"End If'-------cherche le dossier dans l'index------FolFound = FalseFor i=EstPlace To ublaIf Folpath = Folindex(i) ThenEstPlace=iFolFound = TrueExit ForEnd IfNextIf FolFound = False ThenFor i=0 To EstPlaceIf Folpath = Folindex(i) ThenEstPlace=iFolFound = TrueExit ForEnd IfNextEnd If'-----------si il l'a trouv-------------If FolFound = True ThenFolindex(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) rsoudre a demanderait'--qu'on rescan toute la liste des dossier, a prendrait trop d temp. Donc je laisse ce bogue l.If iubla ThenExit DoEnd IfLoopEnd If'------complete ListB avec les listes suivantes appartenant au mme dossier-----If hublb ThenExit DoEnd Ifl = ListB(h)isvc = InStr(l, VbCrlf)-1Looph=h-1End If'-------Efface si identique----If TempListA = TempListB ThenTempListA = ""TempListB = ""Else'--------Trie les deux listes-------tla = Split(TempListA, VbCrlf)ArraySort tladebuga.WriteLine Join(tla, VbCrlf)tlb = Split(TempListB, VbCrlf)ArraySort tlbdebugb.WriteLine Join(tlb, VbCrlf)'--------Avance dans les deux listes jusqu'au premier changement-------ubtla=UBound(tla)ubtlb=UBound(tlb)EstPlace2=0e=0g=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+1LoopDo While Left(tla(g),1)=" " And g < ubtlag=g+1LoopDo While tlb(e)=""e=e+1LoopDo While Left(tlb(e),1)=" " And e < ubtlbe=e+1LoopIf g < ubtla And e < ubtlb ThenDo While tla(g)=tlb(e) And g < ubtla And e < ubtlbg=g+1e=e+1LoopEnd If'--------Compare les deux listes-------k=gEstPlace2=eFor g=k To ubtlatlag=tla(g) '---necessaire pour eviter de changer tla(g) par la fonction GetnameNameA = GetName(tlag)If NameA"" ThenFileFound=FalseFor e=EstPlace2 to ubtlbtlbe = tlb(e) '---necessaire pour eviter de changer tla(g) par la fonction GetnameNameB = GetName(tlbe)If NameB"" ThenIf NameA=NameB ThenIf tla(g) tlb(e) And InStr(1, tla(g), "", 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 = SizeADateB = DateASplitDatas tla(g)If SizeB SizeA ThenModified(mo) = tla(g) & "===>" & tlb(e) : mo=mo+1ElseIf DateDiff("n", DateB, DateA) 0 ThenIf Month(DateB) Day(DateA) _Or Day(DateB) Month(DateA) _Or Year(DateB) Year(DateA) _Or Hour(DateB) Hour(DateA) _Or Minute(DateB) Minute(DateA) ThenModified(mo) = tla(g) & "===>" & tlb(e) : mo=mo+1End IfEnd IfIf mo>ubmo Thenubmo=ubmo+50ReDim Preserve Modified(ubmo)End IfEnd If'-------EstPlace2=e+1FileFound=TrueExit ForElseIf NameA < NameB ThenEstPlace2=eExit ForElseAdded(ad) = tlb(e)ad=ad+1If ad>ubad Thenubad=ubad+50ReDim Preserve Added(ubad)End IfEnd IfEnd IfNextIf FileFound=False ThenMissing(mi) = tla(g)mi=mi+1If mi>ubmi Thenubmi=ubmi+50ReDim Preserve Missing(ubmi)End IfEnd IfEnd IfNextIf e < ubtlb ThenFor e=EstPlace2 to ubtlbtlbe = tlb(e) '---necessaire pour eviter de changer tla(g) par la fonction GetnameNameB = GetName(tlbe)If NameB "" ThenAdded(ad) = tlb(e)ad=ad+1If ad>ubad Thenubad=ubad+50ReDim Preserve Added(ubad)End IfEnd IfNextEnd 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 Thenfl(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 hublb ThenExit DoEnd Ifl = ListB(h)isvc = InStr(l, VbCrlf)-1Looph=h-1End Iftlb = Split(TempListB, VbCrlf)ArraySort tlbubtlb=UBound(tlb)'---------procde avec les lments de la liste-----e=0Do While tlb(e)=""e=e+1LoopDo While Left(tlb(e),1)=" " And e < ubtlbe=e+1LoopIf os = "W98" ThenDo Until Left(tlb(e),3)=".. " Or e=ubtlb-1e=e+1LoopElseIf os = "XP" ThenDo Until Right(tlb(e),3)=" .." Or e=ubtlb-1e=e+1LoopEnd Ifk=e+1LoopCount=0If k=ubtlb ThenIf Left(tlb(k),19) = "Total files listed:" Or Left(tlb(k),3) = ".. " Or Right(tlb(k),3) = " .." Thenfl(a) = fl(a) & "[EMPTY]" & VbCrlfElsefl(a) = fl(a) & "ADDED:" & VbCrlf & tlb(k) & VbCrlfEnd IfElsefl(a) = fl(a) & "ADDED:" & VbCrlfFor e=k To ubtlbtlbe = tlb(e)If tlbe "" _And Left(tlbe,3) ".. " _And Right(tlbe,3) " .." _And Left(tlbe,1) " " _And Left(tlbe,19)"Total files listed:" Thenfl(a) = fl(a) & tlbe & VbCrlfLoopCount = LoopCount + 1End IfNextIf LoopCount=0 Thenfl(a) = Replace(fl(a), "ADDED:", "[EMPTY]")End IfEnd Iffl(a) = fl(a) & "-------------------" & VbCrlf'---------ajoute au dcompte des dossiers en plus---------AddFolCount = AddFolCount + 1AddFileCount = AddFileCount + LoopCounta=a+1If a>ubfl Thenubfl=ubfl+50ReDim Preserve fl(ubfl)End IfElse'--------Cas de dossier trouv-------'------sauve les dcomptes----ModFileCount = ModFileCount + moMissFileCount = MissFileCount + miAddFileCount = AddFileCount + ad'----------i=0If Modified(i)"" Then fl(a) = fl(a) & "MODIFIED:" & VbCrlfFor i=0 To ubmoIf Modified(i)="" ThenExit ForElsefl(a) = fl(a) & Modified(i) & VbCrlfEnd IfNextfl(a) = fl(a) & "-------------------" & VbCrlfi=0End IfIf Missing(i)"" Then fl(a) = fl(a) & "MISSING:" & VbCrlfFor i=0 To ubmiIf Missing(i)="" ThenExit ForElsefl(a) = fl(a) & Missing(i) & VbCrlfIf InStr(1, Missing(i),"", 1)>0 ThenMissFileCount = MissFileCount -1If FolPath = "C:\" ThenMissFolCount = MissFolCount +1End IfEnd ifEnd IfNextfl(a) = fl(a) & "-------------------" & VbCrlfi=0End IfIf Added(i)"" Then fl(a) = fl(a) & "ADDED:" & VbCrlfFor i=0 To ubadIf Added(i)="" ThenExit ForElsefl(a) = fl(a) & Added(i) & VbCrlfIf InStr(1, Added(i),"", 1)>0 ThenAddFileCount = AddFileCount -1If FolPath = "C:\" ThenAddFolCount = AddFolCount +1End IfEnd ifEnd IfNextfl(a) = fl(a) & VbCrlf & "-------------------" & VbCrlfi=0End IfIf fl(a)"" Thenfl(a) = Folpath & VbCrlf & "-------------------" & VbCrlf & fl(a)a=a+1If a>ubfl Thenubfl=ubfl+50ReDim Preserve fl(ubfl)End IfEnd IfEnd If '----rfre "If FolFound = False Then"'----debug----'DebugFile.WriteLine Timer - debugtime1'---------End If '------rfre "If isvc > 1 Then"z=z+1If z=30 ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\FileDone", h,"REG_SZ"z=0End IfNext '--------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=1For j=1 To ublaIf Folindex(j)"" ThenFolFound = FalseFor i=EstPlace To ublbl = ListB(i)isvc = InStr(l, VbCrlf)-1If isvc > 1 ThenFolPath = Left(l,isvc)If Folpath = Folindex(j) ThenEstPlace=iFolFound = TrueExit ForEnd IfEnd IfNextIf FolFound = False ThenFor i=0 To EstPlacel = ListB(i)isvc = InStr(l, VbCrlf)-1If isvc > 1 ThenFolPath = Left(l,isvc)If Folpath = Folindex(j) ThenEstPlace=iFolFound = TrueExit ForEnd IfEnd IfNextEnd If'----s'il ne l'a pas trouv-----If FolFound = False ThenFolpath = 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 jubla ThenExit DoEnd Ifl = ListA(j)isvc = InStr(l, VbCrlf)-1Loopj=j-1End If'---------procde avec les lments de la liste-----CHANGEtla = Split(TempListA, VbCrlf)ArraySort tlaubtla=UBound(tla)LoopCount=0fl(a) = fl(a) & "MISSING:" & VbCrlfFor g=0 To ubtlatlag=tla(g)NameA = GetName(tlag)If NameA "" Thenfl(a) = fl(a) & tla(g) & VbCrlfLoopCount = LoopCount + 1End IfNextIf LoopCount=0 Thenfl(a) = Replace(fl(a), "MISSING:", "[EMPTY]")End Iffl(a) = fl(a) & "-------------------" & VbCrlf'---------ajoute au dcompte des dossiers en plus---------MissFolCount = MissFolCount + 1MissFileCount = MissFileCount + LoopCounta=a+1If a>ubfl Thenubfl=ubfl+50ReDim Preserve fl(ubfl)End IfEnd IfEnd IfNext'-------Progrs-------WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",7,"REG_SZ"'MsgBox "ok, continuez" ,,"debug 2"'-----------Nettoye la mmoire--------Erase ListAErase ListBErase FolindexErase tlaErase tlbTempListA = NullTempListB = Nulll=Null'------------trie les dossiers------- For i=1 To ubfl v = fl(i)If InStr(v, VbCrlf)>0 Thenf = 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 j0 Thenn = "MODIFIED:"ElseIf InStr(Group(j), "MISSING:")>0 Thenn = "MISSING:"ElseIf InStr(Group(j), "ADDED:")>0 Thenn = "ADDED:"Elsen = ""End IfIf n"" Then.WriteLine "" & n & "
".WriteLine ""sl=Split(Group(j), VbCrlf)ubsl=UBound(sl)Select Case nCase "MODIFIED:"For k=1 To ubslIf InStr(sl(k), "===>") >0 Thenmodi = Split(sl(k), "===>")SplitDatas modi(0)If NameA"" Then.WriteLine VbTab & "" & NameA & "" & SizeA & "" _& DateA & ""VerA = GetVersion(FolPath & "\" & NameA)SplitDatas modi(1).WriteLine VbTab & "" _& ""& VerA & "" _& "" & SizeA & "" & DateA & "".WriteLine VbTab & ""End IfEnd IfNextCase "MISSING:"For k=1 To ubslIf sl(k)"" ThenSplitDatas sl(k)If NameA"" Then.WriteLine VbTab & "" & NameA & "" & SizeA & "" _& DateA & ""End IfEnd IfNextCase "ADDED:"For k=1 To ubslIf sl(k)"" ThenSplitDatas sl(k)If NameA"" ThenVerA = GetVersion(FolPath & "\" & NameA).WriteLine VbTab & "" & NameA & "" _& ""& VerA & "" _& "" & SizeA & "" & DateA & ""End IfEnd IfNextEnd Select.WriteLine "".WriteLine ""End IfNext.WriteLine ""End IfNext.WriteLine "This report was written using " & MyTitle & "".WriteLine "".CloseEnd With'------Ecrit Reports Comment Index----If fso.FileExists("Reports_Comment_Index.htm") = False ThenSet OutputFile = fso.CreateTextFile("Reports_Comment_Index.htm", True)With OutputFile.WriteLine "SysFileChecker Reports Index".WriteLine " body{background-color:#FCF3DA;} hr{color:wheat} ".WriteLine "".WriteLine "".WriteLine "Installed Files Checker Reports Index".WriteLine "".WriteLine "".WriteLine "" & SysCheckFile & " ".WriteLine "" & FormatDateTime(Date,VBLongDate) & " - " & MyComment.WriteLine "".CloseEnd WithMsgBox "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, MyTitleElseSet OutputFile = fso.OpenTextFile("Reports_Comment_Index.htm", 8)With OutputFile.WriteLine "" & SysCheckFile & " ".WriteLine "" & FormatDateTime(Date,VBLongDate) & " - " & MyComment.WriteLine "".CloseEnd WithEnd If'_______________________________________________________'--------Message final-------WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",8,"REG_SZ"If NoArgument = True ThenIf 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 ThenWshShell.Run SysCheckFile,3,FalseEnd ifEnd 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:" ThenGetName = 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)" ." ThenDo Until InStr(t, " ")=0t=Replace(t," "," ")Loop MyArray = Split(t," ")If UBound(MyArray) > 2 + IsPM ThenGetName = UCase( Mid(t, InStr(t, MyArray(3 + IsPM)) ) )ElseGetName = ""End IfElseGetName = ""End IfEnd Function

'--------Fonctions--------Function SplitDatas(t)Do Until InStr(t, " ")=0t=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 ThenDatePlace = imaExit ForEnd IfNextDateA = Replace(MyArray(DatePlace -1) & " " & MyArray(DatePlace), ".", "/")'-----Cherche la Taille---If InStr(NameA, ".")>0 ThenFor ima = 2 To DatePlace -2SizeA = SizeA & MyArray(ima)NextElse '---pas d'extention au fichier donc une colonne en moin!If InStr(t, "")>0 ThenSizeA = "[Folder]"ElseFor ima = 1 To DatePlace -2SizeA = SizeA & MyArray(ima)NextEnd IfEnd 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 ThenIf InStr(MyArray(2 + IsPM),"")>0 Then '-----dossiersSizeA = "[Folder]"ElseSizeA = MyArray(2 + IsPM)End IfDateA = MyArray(0) & " " & MyArray(1)If IsPM=1 ThenDateA = DateA & " " & MyArray(2)ElseDateA = Replace(DateA, ".", "/")End IfNameA = Mid(t, InStr(t, MyArray(3 + IsPM)) )End IfSizeA = 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 ThenIf fso.FileExists(t)=True ThenGetVersion = fso.GetFileVersion(t)End IfEnd IfEnd Function'-----Fin de la fonction----------

'-----------sort function---------Function ArraySort(ArrY)If os="XP" ThenExit Function '-----dja trisEnd IfReDim TempArray(255)For Each Word in ArrYUCaseWord = UCase(Word) & " "TempArrayNum = Asc(Left(UCaseWord,1))TempArray(TempArrayNum) = TempArray(TempArrayNum) & Word & VBCrlfNextFor Each SmallList In TempArrayIf SmallList "" ThenSmallArray = Split( SmallList ,VBCrlf)nUB = UBound(SmallArray)If InStr(SmallList, "~2")=0 ThenInsertionSort SmallArrayElseInsertionSortB SmallArrayEnd IfBigList = BigList & Join(SmallArray,VbCrlf)End IfNextArrY = Split(BigList,VbCrlf)End Function

'-----------sort function---------Function InsertionSortB(arrX)Dim i, j, v, v2, wFor i=1 To nUBv = arrX(i)v2 = vIf InStr(v,"~")>0 Thenv = LTrim(UCase(Mid( v, InStr(v,":") +4 )))End Ifj=iw = arrX(j-1)If InStr(w,"~")>0 Thenw = LTrim(UCase(Mid( w, InStr(w,":") +4 )))End IfDo While w > varrX(j) = arrX(j-1)j=j-1If j0 Thenw = LTrim(UCase(Mid( w, InStr(w,":") +4 )))End IfLooparrX(j) = v2NextEnd 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 j0 Thenid("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 Thenr=0WshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ"err.ClearEnd Ifv = WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\WScriptVersion")If err.Number 0 ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\WScriptVersion",0,"REG_SZ"err.ClearEnd IfOn Error GoTo 0If r0 ThenIf 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 '--retryWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ"ElseMsgBox "Action canceled", 0+48, document.Titlewindow.closeEnd ifElseIf r=-1 ThenWshShell.RegWrite "HKCU\SOFTWARE\DingueVBS\CheckSystemHtml",0,"REG_SZ"id("ProgBarText0").innerText = "Waiting for you to start. Note: There was an error last time."End IfClockSpan1 = ""ClockSpan2 = "Checking folder: "End Sub

Sub Go'--------check for ScanList.txt------If fso.FileExists("ifc.ini")=False ThenMsgBox "Thanks for using Installed Files Checker!" _& VbCrlf & "Please proceed with the configuration settings.",0+64,document.TitleCreateObject("WScript.Shell").Run "ifc_config13.hta" , 1, Falsewindow.closeExit SubEnd If'-------check if scan already done---If id("EnterBug").value = "ok" And id("BtnHelp").value = "Help" ThenIf 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 ThenExit SubElseid("EnterBug").value = ""id("Result").innerHTML = "Comment for the report:
"End IfEnd Ifid("BtnGo").disabled = Trueid("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 MyCommentobjOutputFile.Closeid("Comment").disabled = True'------set filename-------Dates=NowSysCheckFile = "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, Falseid("ProgBarText0").innerText = "Please wait..."id("ProgBarText01").innerText = "Please wait..."'----launch progress bar------x=0x2=0z=0cf2="?"cf="?"iTimerID = window.setInterval("Progress", 500)End Sub Sub ProgressSelect Case WshShell.RegRead("HKCU\SOFTWARE\DingueVBS\CheckSystemHtml")Case -1window.clearInterval(iTimerID)id("ProgBarText0").innerText = "ERROR! Operation canceled."Case 0id("ProgBarText0").innerText = "Starting, please wait..."

Case 1If x>11 Thenx=0End Ifid("ProgBarText0").innerHTML = "Preparing batch file, please wait." & ClockSpan1 & x+183 & ";"x=x+1

Case 2id("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 d11 Thenx=0End Ifid("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 & ";"x=x+1Case 4If x>11 Thenx=0End Ifid("ProgBarToDo01").innerText = ""id("ProgBarDone01").innerText = String(80, "_")id("ProgBarText01").innerText = "File list: Done"id("ProgBarText0").innerHTML = "Loading datas to memory, please wait." _& ClockSpan1 & x+183 & ";"x=x+1Case 5id("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 & "/" & yid("ProgBarDone1").innerText = String(d, "_")If d11 Thenz=0End Ifid("ProgBarText0").innerHTML = ClockSpan2 & cf & ClockSpan1 & z+183 & ";"Case 6If x>11 Thenx=0End Ifid("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 & ";"x=x+1

Case 7If x>11 Thenx=0End Ifid("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 & ";"x=x+1Case 8window.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 = Falseid("BtnShowDetails").disabled = Falseid("EnterBug").value = "ok"'----lit le rsultat dans le fichier html-----x=0If fso.FileExists(SysCheckFile)=True ThenSet ts = fso.OpenTextFile(SysCheckFile, 1)Do Until Left(t,4)="Diff"If ts.AtEndOfStream ThenMsgBox "Error loading results! (1)",0+16,document.TitleExit SubElset = ts.ReadLineEnd IfLoopr = "" & t & ""ts.SkipLiner = r & ts.ReadLine & "Results saved in " & SysCheckFile & ""Do Until Left(t,4)="Scan"If ts.AtEndOfStream ThenMsgBox "Error loading results! (2)",0+16,document.Titleid("Result").innerHTML = rExit DoElset = ts.ReadLiner = r & tEnd IfLoopts.Closeid("Result").innerHTML = rElseIf x