' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Create the Output File
Set objOutputFile = objFSO.CreateTextFile( strOutputFile, True, True )
' Get the Version of a File and put it in a Message string
For i = 0 To UBound( arrFiles )
if arrFiles(i) <> "" then
ProcessFile arrFiles(i)
End If
Next
' Close the Output File
objOutputFile.Close
Function ProcessFile( strFile )
Dim strMsg, strVersion, timestamp
' Make sure the file exists
If objFSO.FileExists( strFile ) = False Then
strMsg = strFile & " - File not found. "
Else
' Get the Version of the File and put it in a Message string
strVersion = objFSO.GetFileVersion(strFile)
strtimestamp = time()
strMsg = strFile & " " & strVersion & strtimestamp
End If
' Write the Message string to the Screen
Wscript.Echo strMsg
' Write the Message string to the Output File (with a CR LF)
objOutputFile.Write Now & ": " & strMsg &vbCRLF
End Function
|