Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

On a Windows system you can right-click a file, select properties and then select the "Summary" tab to view extra info about a file (including "Title", "Subject", "Author" and "Origin"). Is there a way to read this information using Perl?

Replies are listed 'Best First'.
Re: Windows File Summary Info
by VSarkiss (Monsignor) on Jan 16, 2003 at 21:54 UTC

    The short answer is "Yes". The long answer is that you'll need the Win32::OLE module and a great deal of patience.

    Basically, Win32::OLE will let you talk to any COM object in Windows with Perl. The real work is finding the right object type (for which you can usually use the "OLE browser" that comes with ActiveState and with most Visual Studio distributions, docs on MSDN, whatever you can find), and identifying the right methods to call. Once you have that, the rest is not too bad. Take a look at Dave Roth's web site for hints on how to proceed.

Re: Windows File Summary Info
by ironpaw (Novice) on Jan 16, 2003 at 23:17 UTC

    Excatly what I have just spent days doing. You need dsofile.exe from ms, win32, and it is actually pretty easy.

    Node 215118 - I used this code and with a little help changed

    $propertie­s->SetProp­erty('titl­e',$filename);
    (which would not set properties but then your only asking about reading them) to
    $properties->{'title'} = $filenam3;
    (which works like a charm.

    That should do ya. There is little info out there for this but that link will get you dsofile.exe and the script will bring it all together.

    Edit: 20030117 by Corion : Added formatting, linked node directly