I'm wondering it it is possible to retrieve the file modified date from a windows indexing search.
I'm getting the name of the file with:
objRecordset.Fields.Item("System.ItemName")
And I'm not sure how to check all the properties or fields available in objRecordset
but I've found googling this ones:
SYSTEM.ITEMNAME
SYSTEM.ITEMURL
SYSTEM.FILEEXTENSION
SYSTEM.FILENAME
SYSTEM.FILEATTRIBUTES
SYSTEM.FILEOWNER
SYSTEM.ITEMTYPE
SYSTEM.ITEMTYPETEXT
SYSTEM.KINDTEXT
SYSTEM.KIND
SYSTEM.MIMETYPE
SYSTEM.SIZE
As you can see there's nothing related with the date of the file but I find it difficult to believe this is not somewhere accessible.
This is the vbs
script I'm using right now:
'To run this snippet, save it to a file and run it using cscript.exe from a command line.
'Running the .vbs file with Windows Script Host may cause dialog boxes to open for each item returned from the index.
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"
objRecordSet.Open "SELECT System.ItemName FROM SYSTEMINDEX WHERE DIRECTORY='file:C:/folderIndexed' AND CONTAINS('INSULATING') ORDER BY System.ItemName DESC", objConnection
Do Until objRecordset.EOF
Wscript.Echo objRecordset.Fields.Item("System.ItemName")
objRecordset.MoveNext
Loop