use Win32::OLE; use File::Spec; my $PropertyReader = Win32::OLE->new('DSOleFile.PropertyReader', 'Quit'); my $directory = "c:\\temp"; opendir(DNAME, $directory) || die "Unable to open the requested directory: $directory\n"; while( my $filename = readdir( DNAME ) ) { next if ($filename eq '.' or $filename eq '..'); my $fullfilename = File::Spec->catdir($directory,$filename); my $properties = $PropertyReader->GetDocumentProperties($fullfilename) || die("Unable read file properties for '$fullfilename' ", Win32::OLE->LastError()); if (0 == 0) #ok i was playing # if ( !$properties->{title} || length($properties->{title}) == 0) { $properties->SetProperty('title', "this one"; #why does this not work??? print $properties->title; } else { print "File '$filename' --- Title property is set to '" . $properties->{title} ."'\n"; } } closedir(DNAME);