2

In the Windows File Explorer I can select some 320 different columns1 to display for various files and folders, see the screenshot below. I'd like to be able to manually manipulate the contents of some fields, to be able to sort my folders e.g. on "Business Region". How can I edit the meta data of my folders to utilise these various possible column entries for the file explorer? For example adding a state/province in the "Business Region" column.

NB: We use both Windows 10 and Windows 11.

enter image description here

1 See this answer on Stack Overflow for a more-or-less complete list.

Adriaan
  • 143

1 Answers1

6

If you add the Comments column to a Details view of This PC or the UserProfile folder, you'll see descriptions of the folders' purpose for the Music, Pictrues, and Videos folders. Those are added to the folders via their respective desktop.ini files. Specifically, a value named InfoTip in the [.ShellClassInfo] section. The data can be either a resource reference as seen in the system folders:

[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21790
InfoTip=@%SystemRoot%\system32\shell32.dll,-12689
...

or a string literal:

LocalizedResourceName=Custom Display Name
InfoTip=Custom Comment
...

Edit: Updated info -- Two ways to "hijack" other properties

There are two ways to make use of properties that already exist within the Windows Property System, but that aren't normally properties of folders.

The first which I just recently discovered, has the advantage of being totally contained within the folder's dessktop,ini file, and thus is accesible to a standard user with no need for admin access. The second requires at least one-time admin access for editing the HKLM registry hive to establish mapping between the property and a custom .ini file value.

The easier method though, is limited to the properties found in the FMTID_SummaryInformation property set:

Name Type PID VT code VT name Canonical Name
Title String 2 31 VT_LPWSTR System.Title
Subject String 3 31 VT_LPWSTR System.Subject
Authors Multi-string 4 31 VT_LPWSTR System.Author
Tags Multi-string 5 31 VT_LPWSTR System.Keywords
Total editing time TimeSpan(ish) 10 21 VT_UI8 System.Document.TotalEditingTime
Last Printed FileTime 11 64 VT_FILETIME System.Document.DatePrinted
Content Created FileTime 12 64 VT_FILETIME System.Document.DateCreated
Date last saved FileTime 12 64 VT_FILETIME System.Document.DateSaved
Pages Int32 14 3 VT_I4 System.Document.PageCount
Word count Int32 14 3 VT_I4 System.Document.WordCount
Program Name String 18 31 VT_LPWSTR System.ApplicationName
  • In a Windows Explorer Details view, the Content created and Date last saved columns are normally populated by "mirroring" the file system properties Date created and Date modifed respectively. Setting these values via the desktop.ini file will override this default behavior without affecting the file system properties.

In the desktop.ini file, they are assigned using the format:

  • Prop<PID> = <VT code>,<Property value>
[{F29F85E0-4FF9-1068-AB91-08002B27B3D9}]
Prop2  = 31,Title
Prop3  = 31,Subject 
Prop4  = 31,Author1;Author2
Prop5  = 31,Tags;Tag1;Tag2
; Total editning time is essentially an unsighed TimeSpan,
; entered as a uint64 value representing the ticks in the TimeSpan
Prop10 = 21,90000000000
; Last Printed
Prop11 = 64,1969-07-20T20:17:00
; Content Created
Prop12 = 64,2023-04-20T11:11:11
; Date last saved
Prop13 = 64,1944-06-06T06:30:00
; Pages
Prop14 = 3,942
; Word count
Prop15 = 3,999
Prop18 = 31,Application Name


*** End of update edit ***


To assign other properties, such as Rating, the other piece to the puzzle is the mapping the InfoTip value to the Property System. This is specified in the regsitry, under the key:

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DesktopIniPropertyMap\PropertySetStorage

Screenshot of Regsitry

Every available property can be refeneced by a unique PropertyKey which consists of an FMTID/PID pair. The FMTID is the Format Identifier (FMTID), a group of related properties, and the PID is an integer that references a particular property within the FMTID group.

The FMTID/PID for System.Comments is:
{F29F85E0-4FF9-1068-AB91-08002B27B3D9},6 These values name the subkeys that map that property to the entries found under the PID key:

Name Type Value
Key REG_SZ Value name
Section REG_SZ Section Name
VarType REG_DWORD Data Type

enter image description here

So, following the example InfoTip gives us, we cah "hijack" other properties as well.

While you can find some FMTID/PID listings online, I use NirSoft's Propety System Viewer --- it's a great tool.

So, if you wanted to populate The Country/Region property for folders, you create the registry key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DesktopIniPropertyMap\PropertySetStorage\{B0B87314-FCF6-4FEB-8DFF-A50DA6AF561C}\100 and specify the Key, Section, and VarType for the desktop.ini file.

enter image description here

So with the mapping added to the registry, a folder with a desktop.ini file specifying:

[Custom]
Rating=50
Region=Midwest
[.ShellClassInfo]
InfoTip=and now...

and relavent columns added to a Details view, we get:

enter image description here

Remember:

A folder has to have its ReadOnly atttrube set for the desktop.ini file to be processed. Add the Attributes column to a Details view in Explorer to check the attributes for folders. Ignore the Read-Only checkbox in the Properties dialog, it's not a status indicator.

A quick way to create a basic desktop.ini file and set the folder's ReadOnly attribute at the same time is to assign a custom icon to the folder via the Customize tab in the folder's Properties dialog. You can then edit the desktop.ini file -- adding your custom entries and even delete the custom icon info if you didn't really want it.


Reg export for Country/Region:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DesktopIniPropertyMap\PropertySetStorage{B0B87314-FCF6-4FEB-8DFF-A50DA6AF561C}\100] "Key"="Region" "Section"="Custom" "VarType"=dword:0000001f

Reg export for Rating (note that VarType now specifies VT_UINT, an unsigned integer):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DesktopIniPropertyMap\PropertySetStorage{64440492-4C8B-11D1-8B70-080036B11A03}\9] "Key"="Rating" "Section"="Custom" "VarType"=dword:00000017

Keith Miller
  • 10,694
  • 1
  • 20
  • 35