Reputation: 827
If you open the properties of a file in Windows, there usually is a Details tab. I want to access the information on this tab, but I don't know how. Is there a module for it? Does someone has a code sniplet?
I tried to work with Win32::File's GetAttributes, but these are not the attributes I was looking for.
Upvotes: 2
Views: 1056
Reputation: 1053
use Win32::OLE;
my $objShell = Win32::OLE->new("Shell.Application") or die;
my $objFolder = $objShell->NameSpace($myDir) or die;
my $objFile = $objFolder->ParseName($fileName) or die;
while ( $i <= 34 )
{
my $propertyName = $objFolder->GetDetailsOf($fileName,$i);
my $propertyValue = $objFolder->GetDetailsOf($objFile,$i);
print "$i -- $propertyName -- $propertyValue\n";
$i++;
}
Upvotes: 3
Reputation: 70943
You can instantiate a COM "Shell.Application"
object. It exposes a .NameSpace(folder)
method that returns a reference to the name space of the indicated folder, which holds the information you need. The retrieved instance holds a Items
collection with references to each of the files in the folder, and a .GetDetailsOf(file,property)
to retrieve each of the values seen in the details tab and explorer columns.
Sorry i have no idea of perl, so i can not include any working code.
Upvotes: 1