def GetExtensionInfo(pExtension):
    'Extract data saved in registry for specific extension'
    lHandle = OpenKey(HKEY_CLASSES_ROOT, pExtension)
    lSubKeys, lValueCount, lModified = QueryInfoKey(lHandle)
    lValues = {}
    for lCount in range(0, lValueCount):
        lName, lValue, lType = EnumValue(lHandle, lCount)
        if lName == '':
            lName = "File Type"
        lValues[lName] =lValue
        
    lKey = lValues['File Type']
    lDescription = QueryValue(HKEY_CLASSES_ROOT, lKey)
    lValues['Description'] = lDescription

    lKey += '\\Shell'
    lDefault = QueryValue(HKEY_CLASSES_ROOT, lKey)
    lValues['Default'] = lDefault    
    return lValues
Extract data saved in registry for specific extension
recipes/Python/577441_Run_command_in_Win32_Registry/recipe-577441.py