i'm trying to delete a registry from the Local_Machine\Software in the registry i made a key titles "DeleteMe" as a test to try it out but i cant get it to work iv tried multiple options and they all say that the "subkey" "subkeytree" and "value" do not exist BUT IT DOES! and i hope i'm using the right terminology here to its HKEY_LOCAL_MACHINE\SOFTWARE\DeleteMe i want it and all the sub keys/values deleted.. (i hope key is the right terminology they look just like folders but when right clicked on they have the option "copy key name")
so far best looking thing iv tried was this and i am running Admin on Windows 7 (but i want this to work regardless of the os)
string keyName = @"Software\DeleteMe";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(keyName, true))
{
if (key == null)
{
MessageBox.Show("Not Found");
}
else
{
key.DeleteSubKeyTree("DeleteMe");
}
}