You don't really need to create an access database. The code can work like you have it if you don't mind it being a little inefficient.
Here it is modified a little bit so that the logic works properly.
Const ForReading = 1, ForWriting = 2
Dim fso, txtFile, txtFile2, strLine1, strLine2, strMatch
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtFile1 = fso.OpenTextFile("CurrentDIR.txt", ForReading)
Set f = fso.OpenTextFile("Files2Download.txt", ForWriting, True)
Do Until txtFile1.AtEndOfStream
strMatch = False
strLine1 = txtFile1.Readline
Set txtFile2 = fso.OpenTextFile("LOG.txt", ForReading)
Do Until txtFile2.AtEndOfStream
strLine2 = txtFile2.Readline
If Trim(UCase(strLine2)) = Trim(UCase(strLine1)) Then
strMatch = True
Else
End If
Loop
txtFile2.Close
If strMatch <> True then
f.writeline strLine1
End If
Loop
f.Close
Wscript.Echo "Done"
You can see that I modifed the variable names.......i need the code too. :D
|