I have the problem that my application doesn't start on system start anymore after I added this to the manifest
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
I know that it has something to do with the Windows UAC. But I dont really know how to solve this without losing admin rights on program start.
This is how I write into registry:
if (checkBox13.Checked)
{
File.WriteAllText(@"C:\ProgramData\Programname\autorunstate", "true");
RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk.SetValue("Programname", Application.ExecutablePath.ToString());
}
Would be really nice if someone could tell me how to let the program start on system start now? It worked before I added this line into manifest. Thank you.