Basically, I have a key called "Manufacturer" in my registry under the path provided in the code.
I want to change the value assigned to that key, which should be simple from what I have found in my research
Problem
When I check regedit, it seems the keys were not altered at all.
Its runs fine, no errors. It actually prints my full 'Try' as if it succeeded.
Also when I try the '.GetValue()' method, it returns the value I assigned as if the program worked.
EDIT
I have been informed that the program defaults to a different path than what I have provided. (Thanks)
I do not know how to prevent this though...
//Here is my code:
namespace OEMInfo
{
class Program
{
static void Main(string[] args)
{
String OEM = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OEMInformation\\";
try
{
RegistryKey OEMKey = Registry.LocalMachine.OpenSubKey(OEM, true);
OEMKey.SetValue("Manufacturer", "TEST");
Console.WriteLine("The registry key has been switched\n-----------------------------------------");
Console.WriteLine("Press ENTER to continue.");
Console.ReadLine();
}
catch
{
Console.WriteLine("There was an error switching the registry key!\n-----------------------------------------");
Console.WriteLine("Press ENTER to continue.");
Console.ReadLine();
}
}
}
}
NOTE: I am a newbie, so please bear with me.