I have ~8.000 files [mp4, mkv, jpg, jpeg, png, gif] in ~100 folders (Author1, Author2, Author3, ...). I want to modify each file's metadata field: "contributing artist" - shown in Windows Explorer column as "Authors". Currently the field is empty, for all files.
The value for "Authors" for each file should be named after the folder they are located in.
file hierarchy example:
Z:\
Z:\Author 1
Z:\Author 1\file1.mp4
Z:\Author 1\file2.mkv
Z:\Author 1\file3.jpg
Z:\Author 2
Z:\Author 2\file4.png
Z:\Author 2\file5.mp4
Z:\Author 3
Z:\Author 3\file6.mp4
Z:\Author 3\file7.jpeg
So for file1.mp4 the metadata field "contributing artists" should be "Author 1".
So for file4.png the metadata field "contributing artists" should be "Author 2".
As long as there are no sub-directories under the Author Name directory, you could use something like this
exiftool "-TAG<${Directory;m/\/([^\/]*)/;$_=$1}" /path/to/directories
The only problem is that since you have such different filetypes in your example, you have to figure out which TAG you want to copy to. The names that Windows displays under Properties usually aren't the same as the actual names of the tags it reads. Additionally, Windows might read from multiple tags, depending upon what ones have data, to fill the property it displays.
As far as I can tell, Windows only has a "Contributing Artist" property for videos, not for images. My quick tests shows that it's reading the Artist tag, specifically the ItemList:Artist, which is a Quicktime tag. This will only work for MP4/Mov videos, as exiftool cannot edit MKV videos. For that, you'll have to use FFMpeg.
For image files, I'll assume you mean the "Authors" property. Windows will read from any of these tags: EXIF:Artist, IPTC:By-line, XMP:Creator, or EXIF:XPAuthor. Luckily, there's an overlap in the tag name of Artist, so you could write to that tag for Jpgs, Tiffs, MP4s, or Movs.
For PNG files, Windows doesn't read any embedded metadata except for PNG:CreationTime, which it displays as "Date Taken". You can write to the Artist tag for those, but Windows won't read it. If you check under Properties->Details tab for PNG files, there won't be anything displayed.
After a quick check, you'll find that GIFs are in the same situation as PNGs. You can write to Artist in one and it will be saved in the XMP:Artist tag, but Windows won't display any data.