I am trying to add or change file property. Like this question:
Get or set file details programmatically
but I am getting error. My OS is Windows 8.1. Isn't this code not working my OS.
My code:
ShellObject xml = ShellObject.FromParsingName(@"C:\Users\Muslum\Desktop\test.xml");
var writer = xml.Properties.GetPropertyWriter(); // throw exception in this line
//set value test 1
writer.WriteProperty(SystemProperties.System.Subject, "Test subject");
//set value test 2
//writer.WriteProperty("Test", "Value");
writer.Close();
Error Message:
An unhandled exception of type 'Microsoft.WindowsAPICodePack.Shell.PropertySystem.PropertySystemException' occurred in Microsoft.WindowsAPICodePack.Shell.dll
Additional information: Unable to get writable property store for this property.
Inner exception :
{"Error HRESULT E_FAIL has been returned from a call to a COM component."}
How can I resolve this problem?