couldn't access registry HKLM keys from windows xp limited/guest user accounts
public int GetEnabledStatus()
{
RegistryKey hklm = Registry.LocalMachine;
int Res;
try
{
RegistryKey run1 =
hklm.OpenSubKey(@"Software\Microsoft\Windows\myApp", true);
hkcu.OpenSubKey(@"Software\Microsoft\Windows\myApp", true);
Res = int.Parse(run1.GetValue("enabled").ToString());
}
catch
{
Res = 0;
return Res;
}
finally
{
hklm.Close();
}
return Res;
}
this code works fine in administrator user accounts, under limited/guest accounts call to this function doest not return value. is there any work around