' Define variables. const HKEY_LOCAL_MACHINE = &H80000002 computer = "." ' Get a connection to the local registry (as defined by computer). Set registryConnection=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ computer & "\root\default:StdRegProv") ' Delete the SQLInfo registry key. registryConnection.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\SQLInfo" ' Clear variables. Set computer = Nothing Set registryConnection = Nothing