Sub DeleteKeyAndSubsFromTmpLoadHive(KeyPath) ' Author Jakob H. Heidelberg ' Version 1.2 On Error Resume Next Const HKEY_USERS = &H80000003 Dim arrSubkeys, strSubkey Dim strKeyPath strKeyPath = Trim(KeyPath) Dim objRegistry Set objRegistry = GetObject(Winmgmts.RootDefaultStdRegProv) objRegistry.EnumKey HKEY_USERS, strKeyPath, arrSubkeys If IsArray(arrSubkeys) Then For Each strSubkey In arrSubkeys DeleteKeyAndSubsFromTmpLoadHive strKeyPath & & strSubkey Next End If objRegistry.DeleteKey HKEY_USERS, strKeyPath Set objRegistry = Nothing End Sub