I've had no trouble creating/deleting keys to the CurrentUser but whenever I try LocalMachine nothing happens. I've added ("requestedExecutionLevel level="requireAdministrator" uiAccess="false")
to the app.manifest. Am I missing something?
private void button1_Click(object sender, EventArgs e)
{
RegistryKey rKey;
rKey = Registry.LocalMachine.OpenSubKey("Software", true);
rKey.DeleteSubKey("test", true);
rKey.Close();
}
private void button2_Click(object sender, EventArgs e)
{
RegistryKey rKey;
rKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", true);
rKey.CreateSubKey("test");
rKey.Close();
}