shell.SHGetFileInfo

int, SHFILEINFO = SHGetFileInfo(name, dwFileAttributes , uFlags , infoAttrs )

Retrieves information about an object in the file system, such as a file, a folder, a directory, or a drive root.

Parameters

name : string/PyIDL

The path and file name. Both absolute and relative paths are valid.
If the uFlags parameter includes the SHGFI_PIDL flag, this parameter must be a valid PyIDL object that uniquely identifies the file within the shell's namespace. The PIDL must be a fully qualified PIDL. Relative PIDLs are not allowed.
If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this parameter does not have to be a valid file name. The function will proceed as if the file exists with the specified name and with the file attributes passed in the dwFileAttributes parameter. This allows you to obtain information about a file type by passing just the extension for pszPath and passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes.
This string can use either short (the 8.3 form) or long file names.

dwFileAttributes : int

Combination of one or more file attribute flags (FILE_ATTRIBUTE_ values). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored.

uFlags : int

Combination of shellcon.SHGFI_* flags that specify the file information to retrieve. See MSDN for details

infoAttrs=0 : int

Flags copied to the SHFILEINFO.dwAttributes member - useful when flags contains SHGFI_ATTR_SPECIFIED