Function EnumKeys(lngHive, strKeyPath) 'Returns a tab-delimited list of subkeys 'Const HKCR = &H80000000 'Const HKCU = &H80000001 'Const HKLM = &H80000002 'Const HKU = &H80000003 'Const HKCC = &H80000005 Dim strKeys, objReg, arrSubKeys, subkey Set objReg = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\.\root\default:StdRegProv") objReg.EnumKey lngHive, strKeyPath, arrSubKeys For Each subkey In arrSubKeys If strKeys <>"" Then strKeys = strKeys & vbTab strKeys = strKeys & subkey Next EnumKeys = strKeys End Function