'========================================================================== ' ' VBScript: AUTHOR: Ed Wilson , MS, 12/15/2003 ' ' NAME: ' ' COMMENT: Key concepts are listed below: '1.use of constants for registry '2.use of enumKey method '3.use of StdRegProv '========================================================================== Option Explicit On Error Resume Next Dim strKeyPath Dim strComputer Dim objReg Dim subKey Dim arrSubKeys Const HKCR = &H80000000 'HKEY_CLASSES_ROOT Const HKCU = &H80000001 'HKEY_CURRENT_USER Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE Const HKU = &H80000003 'HKEY_USERS Const HKCC = &H80000005 'HKEY_CURRENT_CONFIG strKeyPath = "SOFTWARE\Microsoft\Windows NT" _ & "\CurrentVersion\HotFix" strComputer = "." Set objReg=GetObject("winmgmts:\\" &_ strComputer & "\root\default:StdRegProv") objReg.EnumKey HKLM, strKeyPath, arrSubKeys WScript.Echo("Keys under " & strKeyPath) For Each subKey In arrSubKeys WScript.Echo vbTab & subKey Next