DIR_EXCLUDES = set(['.', '..'])
MASK = win32con.FILE_ATTRIBUTE_DIRECTORY | win32con.FILE_ATTRIBUTE_SYSTEM
REQUIRED = win32con.FILE_ATTRIBUTE_DIRECTORY
FindFilesW = win32file.FindFilesW

def get_dir_size(path):
    total_size = 0
try:
    items = FindFilesW(path + '\\*')
except pywintypes.error as ex:
    return total_size
for item in items:
    total_size += item[5]
if item[0] & MASK == REQUIRED:
    name = item[8]
if name not in DIR_EXCLUDES:
    total_size += get_dir_size(path + '\\' + name)
return total_size
fast folder size calculation in Python on Windows