In my C# WPF application, I am setting an application as a startup application by creating a new key in the startup registry as follows:
RegistryKey startapp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\CurrentVersion\\Run", true);
startapp.SetValue("Myexe.exe", Aseembly.GetExecutingAssembly().Location);
Process.Start("Myexe.exe", url);
This runs fine and the registry value gets set, as checked in regedit. The user ought to have administrative privileges for setting the registry.
Also, the problem is that on rebooting the computer, I noticed that the application runs on startup only if the User Account Control has been turned off (with least security), and not the default settings. This is not the case for other applications such as Google Talk etc. in my computer? So, how do I allow my application to run at startup, even if the user account control UAC settings are bit high?