My program runs this code to add an autostart key to the registry:
The problem here is that I can't see the key it has created in regedit.Code:Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyAppName", "" + Application.ExecutablePath + "");
If I run some code to get the value of the key in my program, it returns a correct value. Meaning that the program can read the key but I can't.
Wt*?
I am admin btw and have UAC off.
EDIT: Another question too: Why can I set a value with the above code but I receive an unauthorizedexception when doing it with the OpenSubKey thingy?





Reply With Quote