On Error Resume NextConst HKEY_LOCAL_MACHINE = &H80000002strComputer = "." Set objRegistry=GetObject("winmgmts:\\" & _ strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeysFor Each objSubkey In arrSubkeys Result = InStr(objSubkey, ".BAK") if Result <> 0 then objRegistry.DeleteKey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ & objSubkey, strKeyPath else End IfNext