I have been using the replies from here to read out the metadata of files on windows. However i noticed that it would just ignore hidden files.
How can one also include hidden files in this approach?
You can combine python's os library with Windows' Shell.Application object, as done here, something like this:
import os
import win32com.client
sh = win32com.client.gencache.EnsureDispatch('Shell.Application', 0)
path = r'c:\mypath\myfolder'
ns = sh.NameSpace(path)
colnum = 0
columns = []
while True:
colname=ns.GetDetailsOf(None, colnum)
if not colname:
break
columns.append(colname)
colnum += 1
for name in os.listdir(path): # list all files
print(path + '\\' + name)
item = ns.ParseName(name)
for colnum in range(len(columns)):
colval=ns.GetDetailsOf(item, colnum)
if colval:
print('\t', columns[colnum], colval)
hidden files will display (H attribute is for Hidden)
...
Attributes HA
...