# Ruby code to read Windows file summary information
require 'win32ole'
obj= WIN32OLE.new("Shell.Application")
folder=obj.nameSpace("d:\\0-dwn")
item = folder.items.item("test.doc")
(0..99).each do |i|
puts "#{i}-->"+folder.getDetailsOf(nil, {:iColumn => i }) +"--
"+folder.getDetailsOf(item, {:iColumn => i })
end
Output:
0-->Name-->test.doc
1-->Size-->20 KB
2-->Type-->Microsoft Word Document
3-->Date Modified-->5/14/2010 1:48 PM
4-->Date Created-->5/14/2010 11:09 AM
5-->Date Accessed-->5/14/2010 1:48 PM
6-->Attributes-->A
7-->Status-->Online
8-->Owner-->ACER1\john_s
9-->Author-->Au: John S
10-->Title-->Tit: test
11-->Subject-->Sj: Test file summary
12-->Category-->Cat:Test verification
13-->Pages-->1
14-->Comments-->Com: test file verification program
15-->Copyright-->
16-->Artist-->
17-->Album Title-->
18-->Year-->
19-->Track Number-->
20-->Genre-->
21-->Duration-->
22-->Bit Rate-->
23-->Protected-->
24-->Camera Model-->
25-->Date Picture Taken-->
26-->Dimensions-->
27-->-->
28-->-->
29-->Episode Name-->
30-->Program Description-->
31-->-->5/14/2010 10:41 AM
32-->Audio sample size-->
33-->Audio sample rate-->
34-->Channels-->
35-->Company-->
36-->Description-->
37-->File Version-->
38-->Product Name-->
39-->Product Version-->
40-->Keywords-->
:::
:::