Here is how you could do it in C #:
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",
"MyStartUp",
@"C:\StartUpApp.exe");
You basically need to add an entry to the registry. The above works at startup. There are a few more. I recommend downloading a tool like Autoruns to see all possible locations.
source
share