For the past two days I have been scanning the Internet to try to find the solution to my problem. I have a folder of different files. They run the gambit of file types. I a
Windows API Code Pack may be used with Python for .NET to read/write file metadata.
Download the NuGet packages for WindowsAPICodePack-Core and WindowsAPICodePack-Shell
Extract the .nupkg files with a compression utility like 7-Zip to the script's path or someplace defined in the system path variable.
Install Python for .NET with pip install pythonnet.
Example code to get and set the title of an MP4 video:
import clr
clr.AddReference("Microsoft.WindowsAPICodePack")
clr.AddReference("Microsoft.WindowsAPICodePack.Shell")
from Microsoft.WindowsAPICodePack.Shell import ShellFile
# create shell file object
f = ShellFile.FromFilePath(r'movie..mp4')
# read video title
print(f.Properties.System.Title.Value)
# set video title
f.Properties.System.Title.Value = 'My video'
Hack to check available properties:
dir(f.Properties.System)