[C# - Registry] Piriform registry key not accessible

Hi,

I've find a strange thing on my computer (Win 7 x64 Pro Fr) with CCleaner 3.07 and Defraggler 2.05.

(I've uninstalled both and installer only CCleaner 3.10 with the same problem

This C#.NET code works :

Ce code fonctionne :

RegistryKey CurrentKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft");

This C#.NET code works too (HKCU) :

RegistryKey CurrentKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Piriform");

This C#.NET code returns null :

RegistryKey CurrentKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Piriform");

Here's the Registry export :

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Piriform\CCleaner]

"UpdateCheck"="1"

@="C:\\Program Files\\CCleaner"

I've checked Registry autorisations.

I've added a manifest file :

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />.

I've tried overloaded functions :

RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.ReadKey

Any idea ?

Thanks,

Vincent

:blink:

Not sure what you are asking or are trying to achieve

Hi,

I need to retrieve default value at HKEY_LOCAL_MACHINE\SOFTWARE\Piriform\CCleaner which contain CCleaner install path only.

Hi,

I've got a partial answer from a M$ forum :

http://msdn.microsoft.com/en-us/library/aa384232%28v=VS.85%29.aspx

I'm using a 64 bits Windows version under Windows 7 were a reflection mechanism is done for 32/64 bits compatibility.