Feroz Khan

Feroz Khan

  • 1.4k
  • 300
  • 92.4k

how can i change registry of local machine and currnet user

Jul 27 2015 7:33 AM
hello Everyone,
 
how can i change registry from local machine and current user through c#  without admin access i tried with below code but showing error.. 
 please below code and help me about this how can i change registry with user without admin... 
 
RegistryKey regkey;
RegistryKey regkeym;
regkey = Registry.CurrentUser.CreateSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", RegistryKeyPermissionCheck.ReadWriteSubTree, rs);
regkeym = Registry.LocalMachine.CreateSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", RegistryKeyPermissionCheck.ReadWriteSubTree, rs);
regkey.SetValue("NoViewOnDrive", 67108863, RegistryValueKind.DWord);
regkeym.SetValue("EnableLUA",1, RegistryValueKind.DWord);
regkey.Close();
regkeym.Close();
 
Note:  when i run application in with user account it is showing below error..