You need to take into account registry redirection; that's the real issue here. On a 32-bit machine, the key you need doesn't have WoW6432Node in the path.
You are trying to delete
HKEY_CLASSES_ROOT\CLSID\{D9AC2148-5E15-48AD-A693-E48714592381}
from the 32-bit view of the registry. Microsoft is very clear that you should not hard code WoW6432Node in your applications:
Redirected keys are mapped to physical locations under Wow6432Node. For example, HKEY_LOCAL_MACHINE\Software is redirected to HKEY_LOCAL_MACHINE\Software\Wow6432Node. However, the physical location of redirected keys should be considered reserved by the system. Applications should not access a key's physical location directly, because this location may change.
So delete that key by calling
DeleteSubKey(@"HKEY_CLASSES_ROOT\CLSID\{D9AC2148-5E15-48AD-A693-E48714592381}")
But use the redirector to ensure that you operate on the 32-bit view of the registry.
In .NET you can achieve what you need in two ways.
- Target x86 and let redirection do the work for you.
- If you target x64 or AnyCPU, you need to use
RegistryView.Registry32
(new in .NET 4) to open a 32-bit view of the registry. If you don't have .NET 4 then you have to P/Invoke.