How to get meta data for hidden files on windows in Python
See the question and my original answer on StackOverflowYou 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
...