def get_shellfolders(branch=HKCU, key=SHELL_FOLDERS):
    """Return mapping of shell folder names (current user) to paths."""

    key = _winreg.OpenKey(branch, key)
    folders = {}
    i = 0
    while True:
        try:
            ret = _winreg.EnumValue(key, i)
            if ret[2] == _winreg.REG_EXPAND_SZ:
                folders[ret[0]] = expandvars(ret[1])
            else:
                folders[ret[0]] = ret[1]
        except WindowsError:
            break
        i +=1
    key.Close()
    return folders
Return mapping of shell folder names (current user) to paths.
recipes/Python/473846_Get_systemlanguageuser_dependent_paths/recipe-473846.py