TouchProp allows you to get and set* any file property exposed by the Windows property system. It's available as both a Windows GUI, and a command line application.
* For those properties that are read-write and supported for a file type.
How to use the TouchProp command line program
How to Find the Canonical Name of a Property
The Windows property system provides a generic interface to access filesystem and file metadata properties. Almost everything about a file that you can view and change via Windows Explorer is done through the property system. TouchProp uses this programmatic interface to provide a means of reading and writing these properties in both a Windows GUI and a command line program.
The GUI program is useful for investigation and one-off alterations. If you want to perform the same change on multiple files, the command line program is more suited to that task.
You can find more information on the Windows property system here.
The Windows property system is extensible by third party products, and different versions of Windows may support different properties, so there isn't a definitive list of properties, but the most common and useful are likely to be available in any supported version of Windows.
This is useful in investigating what's possible with the Windows property system.
When you invoke TouchProp, it lists all possible properties that your version of Windows supports. The number of properties varies slightly with each version of Windows but the most useful ones are usually present in all versions. The latest versions of Windows 10 have over 1600 properties.
You can filter the list by:
The "Filter by Text" field | This matches any part of the Canonical Name, Description, or Type names shown in the list. So, for example, if you typed "filetime", you'll largely see only items that are of type "Filetime". If you type "photo", that will match mostly properties for photographs - ones with canonical names that start "System.Photo". |
The "Only show writable items" check box | This filters the list so that it only shows properties that are defined to be writable - those marked as "R/W" (read-write). |
The "Only show items with description text" check box | This filters the list to only show items that have a description - these are usually the common ones capable of being shown by Windows. |
To view or change properties of a file, first use the Browse button to select a file, or enter the full path and file name in the "File/Folder" field.
If there's a property selected in the list, the "Value" field will show the current value of that property for the file. If the file doesn't have a value for that property, the "Value" field displays [EMPTY]. Select different properties in the list to see the current value of the file's property.
To evaluate this, it's initially useful to choose a photo file that you know has some known property values - System.Photo.DateTaken is almost always present in photos from a digital camera or smartphone.
If you want to change the value of a file's property, select the property in the list to see any current value, type your new value and click the "Set" button. Some properties allow one of several preset choices. For example, the System.Photo.Contrast property can currently have one of 3 values: Hard, Normal, or Soft. For such properties, the "Value" field's drop list will contain the possible options, so you don't need to know what the 3 values are, you can pick one from the drop list.
TouchProp outputs full usage information if you run it without any command line parameters.
Here are some examples:
The following command will output the Comments property of the file MyPhoto.jpg:
TouchProp MyPhoto.jpg System.Comment
While the following command will change the Comments property of the file MyPhoto.jpg to: "A great photo":
TouchProp MyPhoto.jpg System.Comment "A great photo"
Similarly, the following command will change the jpg file's "Date Taken" property to 11:22:33 25 December 2001
TouchProp MyPhoto.jpg System.Photo.DateTaken "2001/12/25:11:22:33.456"
The names "System.Comment" and "System.Photo.DateTaken" in the examples are known as the canonical property name. You can find information on canonical names here.
It's easiest to find the canonical name with the GUI version of TouchProp as it lists all possible properties and allows filtering, so you just need to type a partial guess at the property name and see what shows up in the list. Once you've found the property you want, if it's one that takes one of a preset list of options, those are shown in the "Value" drop list.
If you want to use the command line program, you can get a list of all the possible properties available on your system by using the following command:
TouchProp -listprops
It's probably easiest to deal with this list by redirecting the output to a file:
TouchProp -listprops > properties.txt
Then load the output file into your favourite spreadsheet program (such as Microsoft Excel). It's a tab delimited file, so should import easily into the spreadsheet.
Once loaded into a spreadsheet, each row contains the following columns:
Note that the canonical name must be spelled correctly with the correct case. So, for example, "system.author" will not work, it has to be "System.Author".
The following are types from my Windows installations, additional ones may be listed on your system.
Listed as | Description | Output example | Input format/example |
---|---|---|---|
IntN | 1-8 byte signed integer number | 1234 [-1234] | 1234 |
UIntN | 1-8 byte unsigned integer number | 5678 | 5678 |
RealN | Floating point (real) number | 12.34 | 12.34 |
Boolean | Boolean value | Depends on the specific property | Depends on the specific property |
Unicode String | |||
Filetime | Date+time timestamp | Your locale date/time format | Your locale date/time format, or the internal format: yyyy/MM/dd:HH:mm:ss.fff yyyy: 4 digit year MM: 2 digit month dd: 2 digit date HH: 24h hours mm: minutes ss: seconds fff: thousandths of a second |
Vector of ... | The property is multi-valued | Value1;Value2;Value3 | Value[;ValueN] |
All properties are not applicable to all file types.
If a file doesn't have a value for a property, TouchProp outputs: "[EMPTY]".
The list from the -listprops option will show lots of properties that have types that are not currently supported by TouchProp. For example:
VT_BLOB | Length-prefixed bytes |
VT_STREAM | The name of the stream follows |
VT_CF | Clipboard format |
VT_CLSID | A class ID |
VT_UNKNOWN | IUnknown |
TouchProp currently does nothing with these types of properties. If you encounter one of these (or some other) that you think would be useful, please let us know.
If you're not familiar with handling timestamps in PowerShell, here's some information and examples that I've found useful to know.
The following examples assume TouchProp.exe is in the current working directory, and the TestPhoto.jpg file in the parent directory.
$dtVar=Get-Date(.\touchprop ..\TestPhoto.jpg System.Photo.DateTaken)
$dt2=$dtVar.AddHours(1)
$dt2=$dtVar.AddHours(-1)
$dt2.ToString("yyyy/MM/dd:HH:mm:ss.fff")
Many properties can only be discrete enumerated values; they are often (unsigned) integer value types, but are output as one of the enumeration names shown for the property via the -listprops option.
For example, the System.Photo.Contrast property may be output as "Normal", "Soft", or "Hard". You can modify the value by using the value (0, 1, 2) or by the corresponding enumeration output name. Note that if you use the name, it must match exactly, so for this property, "Soft" would be correct, but "soft" would result in an error.
Some property values have "ranged" enumerations - such as date/times, allowing you to use values such as "Yesterday", or "Earlier this month", but they are not precise times, so they're of limited practical use.
Many properties can have multiple values, for example, the System.Author (Authors) property is a multi-valued string property. If you display it using:
TouchProp MyPhoto.jpg System.Author
If the file has that property, TouchProp might output something like this:
David Lowndes; Julie Lowndes
To change the values, you can enter the following command:
TouchProp MyPhoto.jpg System.Author "Ansel Adams[;Yousuf Karsh]"
i.e. repeat the section inside [] for each value, each separated with a semi-colon ';'
Some properties may apparently be written OK , with no problem reported, but the underlying value doesn't change. For example, changing System.GPS.LongitudeDenominator on a JPG never seems to change the values.