Something similar to this script structure might be able to help you out.
Just create a text file (titled "List.txt" within same directory as the script.
Then in the text file arrange the lines as:
1st line: File Name (EXAMPLE: "C:\Windows\System32\<YourFile>")
2nd line: Version (EXAMPLE: 1.0.0.1)
3rd line: Size (EXAMPLE: 1523 [1523 = 1.48KB]) 'The size is calculate in bytes...that can be changed if need be.
If you have two or more files to check just continue the lines within the text file.
File one consists of lines 1 ~ 3
File two consists of lines 4 ~ 6
File three consists of lines 7 ~ 9
etc, etc.
----------------------------------------------------
option explicit
Const ForReading = 1
Dim strScriptPath, strFileName, strDirectory
Dim objFileSO, objLogFile, objTextFile
strScriptPath = Wscript.ScriptFullName
strFileName = "List.txt"
Set objFileSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFileSO.GetFile(strScriptPath)
strDirectory = objFileSO.GetParentFolderName(objLogFile) & "\" & strFileName
Set objTextFile = objFileSO.OpenTextFile(strDirectory, ForReading, True)
Do until objTextFile.AtEndOfStream
FileNames = objTextFile.Readline
Versions = objTextFile.Readline
Size = objTextFile.Readline
Input(FileNames,Versions,Size)
Loop
CleanMemory
wscript.echo "Done!"
Wscript.Quit
Sub Input(FileNames,Versions,Size)
Dim FSO, File, strSize, FileNames, WshShell
Set FSO = CreateObject("Scripting.FileSystemObject")
Set File = FSO.GetFile(FileNames)
If File.Version <> Versions Then
Wscript.echo FileNames & " version was found to be different."
End If
If File.Size <> Size Then
Wscript.echo FileNames & " size was found to be different."
End If
Set File = Nothing
Set FSO = Nothing
Set strSize = Nothing
Set FileNames = Nothing
Set WshShell = Nothing
End Sub
Sub CleanMemory
Set FileNames = Nothing
Set Versions = Nothing
Set Size = Nothing
Set strScriptPath = Nothing
Set strFileName = Nothing
Set strDirectory
Set objFileSO = Nothing
Set objLogFile = Nothing
Set objTextFile = Nothing
End Sub
V/r,
SPC Key
United States Army