You need the folder StartUp for All Users
using System.IO;
using System.Reflection;
private string pathStartUp = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup);
var exe = Assembly.GetExecutingAssembly().Location;
var destiny = Path.Combine(pathStartUp, Path.GetFileName(exe));
var data = File.ReadAllBytes(exe);
File.WriteAllBytes(destiny, data);
It's simpler to just read and write all the bytes of the main app.
EDIT: Changed the variable pathStartUp
to use GetFolderPath
, so it works even on Windows XP, which has a diferente startup path than Windows Vista / 7 / 8.