Hi,
I found this code from "The Scripting Guy" for comparing 2 files and output changes. This works great for what I need.... What I would like to have is a "Browse For File" function for the text files. Is there any easy way to do this? Thanks for any help... I am going to keep searching in the meantime.
I found this code from "The Scripting Guy" for comparing 2 files and output changes. This works great for what I need.... What I would like to have is a "Browse For File" function for the text files. Is there any easy way to do this? Thanks for any help... I am going to keep searching in the meantime.
Code:
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile1 = objFSO.OpenTextFile("C:\Temp\NewRev.txt", ForReading)
strCurrentDevices = objFile1.ReadAll
objFile1.Close
Set objFile2 = objFSO.OpenTextFile("C:\Temp\OldRev.txt", ForReading)
Do Until objFile2.AtEndOfStream
strAddress = objFile2.ReadLine
If InStr(strCurrentDevices, strAddress) = 0 Then
strNotCurrent = strNotCurrent & strAddress & vbCrLf
End If
Loop
objFile2.Close
Wscript.Echo "Changes since last revision: " & vbCrLf & strNotCurrent
Set objFile3 = objFSO.CreateTextFile("C:\Temp\Changes.txt")
objFile3.WriteLine strNotCurrent
objFile3.Close