Author Topic: Windows2000 System File  (Read 9087 times)

0 Members and 1 Guest are viewing this topic.

Bentzien

  • Newbie
  • *
  • Posts: 2
Windows2000 System File
« on: December 19, 2011, 01:41:48 PM »
Hello,

i've a problem, that my users has set to pdf files in windows 2000 properties, which i would see in windows 7. I have attached three screen shots where you can see that the properties are still there, but i can change them in windows7. i think it is an config problem so i hope i get help here.

regards carsten

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Windows2000 System File
« Reply #1 on: December 20, 2011, 12:30:01 AM »
Hello Carsten,
As you may already know, these three metadata properties, shown in the PDF-ShellTools Info tip screenshot you attached, are not part of the PDFs metadata. These are from a metadata system, that uses a NTFS Alternate Data Stream to store the data itself, that MS introduced in Win2K. An ADS is like an additional file, usually hidden by the system, that is attached to the main file. Since Windows Vista there is no longer a Shell native way to edit these properties (the Summary file properties tab sheet no longer exists). This is also a bad method to add metadata to files that support storage of metadata in the file itself, such as the PDF. If you move these files to a media that don't use the NTFS, you will loose the metadata.
PDF-ShellTools don't provide means to manage these non-PDF native metadata properties, and Windows 7 don't use that file summary information system, so the best way to deal with this is to move that metadata to PDFs metadata properties. In your case you can move the Subject to the PDFs Subject standard metadata field, and the other to PDFs custom metadata fields.

You will need a script, such as the one I posted at this forum post, to easily do that. Let me know If you have doubts on how to adapt it to your case.

When done, the PDF-ShellTools property handler Shell extension will provide the means to show, edit and search these properties, using the powerful Windows 7 Property System, that since Windows Vista replaced that, now obsolete, file summary information system.

Bentzien

  • Newbie
  • *
  • Posts: 2
Re: Windows2000 System File
« Reply #2 on: December 20, 2011, 10:47:59 AM »
Hello,

i tried the javascript, but nothing happens.

So how could i stop the handler? I think this could be the problem.

And if the script works how can i make a match that the old meta subject is set to pdf subject, that old meta category is set to pdf keywords and old comments where could they mapped?

-carsten

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Windows2000 System File
« Reply #3 on: December 21, 2011, 01:14:04 AM »
You have to run it from Win2K or XP. From Windows 7 don't work.
Here is another one, adapted to your case.
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");

function setMetadata(params) {
  WshShell.Run('"%ProgramFiles%\\PDF-ShellTools\\PDFShellTools.exe" SetMetadata ' + params, 1, true);
}

var objShell = new ActiveXObject("shell.application");
var objFolder2;
objFolder2 = objShell.NameSpace(WshShell.currentdirectory);
if (objFolder2 != null) {
  var FolderItems;
  FolderItems = objFolder2.Items();
  if (FolderItems != null) {
    var FolderItem;
    var Subject;
    var Category;
    var Comments;
    for (var i = 0; i < FolderItems.count; i++) {
      FolderItem = FolderItems.item(i);
      if (FolderItem.name.split('.').pop().toLowerCase() == 'pdf') {
        Subject = objFolder2.GetDetailsOf(FolderItem, 11);
        Category = objFolder2.GetDetailsOf(FolderItem, 12);
        Comments = objFolder2.GetDetailsOf(FolderItem, 14);
        var cmd = "'Subject=" + Subject + "','Keywords=" + Category + "','Comments=" + Comments + "'";
        //WshShell.Popup(cmd, 0, FolderItem.path, 0x30);
        setMetadata("\"Metadata="+cmd+"\" \"" + FolderItem.path + '"');
      }
    }
  }
}

The comments field is being set to a custom PDF metadata field with the same name (take note that the PDF-ShellTools trial version can't set custom fields). To later show it in Windows 7 you will have to use the PDF-ShellTools manager, under the property handler settings, to create a custom field with the same name. You can also map it to the system comments field, so it show in the same comments column of files that have this field natively.

The column indexes (11 for Subject,12 for Category and 14 for Comments) are for XP. Win2K uses different indexes.
You can use the next script to easily find these columns indexes.
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
var objShell = new ActiveXObject("shell.application");
var objFolder2;
objFolder2 = objShell.NameSpace(WshShell.currentdirectory);
if (objFolder2 != null) {
  var msg = '';
  for (var i = 0; i < 50; i++) {
    msg += objFolder2.GetDetailsOf(objFolder2, i) + "[" + i + "]\n";
  }
  WshShell.Popup(msg, 0, "Message", 0x30);
}