I already took a look at threads like this: Disabling UAC programmatically However they are kinda old and it seems I can't do it. I'm trying to create a Windows tool to help the user doing certian process (like enabling or disabling UAC). Here is my code so far it won't turn down or up the UAC value even with admins right. Right now I'm not using the admin account (Windows 10) but I do have access to the local admin credetial.
try
{
RegistryKey uac = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", true);
if (uac == null)
{
uac = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
}
uac.SetValue("EnableLUA", 0);
uac.Close();
}
catch (Exception)
{
MessageBox.Show("Error!");
}