I've wrote a application which should starts at windows startup. I've add a entry in windows register in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. Entry has been added successfully, but program is not starting properly.
I've tested application on Windows 7 64 bits. Application needs to have admin permissions to run, maybe this is the reason why it is not starting?
I saw also that the entry's value is not in the quotation marks, but the others are. Is it compulsory?
Here is my c# code:
var registry = Registry.CurrentUser;
var key = registry.OpenSubKey(runKeyBase, true);
key.SetValue(KEY, directory + @"\" + filename);
Registry.CurrentUser.Flush();
How cant I make it working?