In addition to Richard's advice, here's a trick I used to allow an application to start at startup:
In your application check if it is run with admin rights, if not then restart it asking for admin rights.
At the moment I do not have my source code at hand, but I will post it tomorrow if you want it.
public static bool IsAdministrator()
{
WindowsIdentity identity = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
private void Form1Shown(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
this.Run1();
this.Cursor = Cursors.Default;
}
private void Run1()
{
if (!Program.IsAdministrator())
{
var exeName = Process.GetCurrentProcess().MainModule.FileName;
ProcessStartInfo startInfo = new ProcessStartInfo(exeName);
startInfo.Verb = "runas";
startInfo.Arguments = "restart";
Process.Start(startInfo);
Application.Exit();
}
}