It gives proper report with last modified date, file path and size of the file in tsv format, you can open this in excel format.
'************ Start of Code **********************
'**********Script by Praveen Kumar****************
'*************************************************
Option Explicit
Dim oFSO, oFolder, sDirectoryPath, sStartPath, oFSO1, sReportName, fReport, oFldr
Dim oFileCollection, oFile, sDir
Dim iDaysOld
sStartPath = "E:\"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFSO1 = CreateObject("Scripting.FileSystemObject")
sReportName = "C:\log.txt"
Set fReport = oFSo1.CreateTextFile(sReportName, True)
fReport.WriteLine "File Path" & vbTab & "File Size" & vbTab & "Last Modified Date"
ListFolders(sStartPath)
Sub ListFolders(sDirectoryPath)
On Error Resume Next
iDaysOld = 1095
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(sDirectoryPath)
Set oFileCollection = oFolder.Files
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
fReport.write oFile & vbtab
fReport.write oFile.Size & vbtab
fReport.Write oFile.DateLastModified & vbnewline
End If
Next
For Each oFldr In oFolder.SubFolders
ListFolders oFldr.Path
Next
End Sub
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing
