c++ program open at startup

Jan 2, 2018 at 4:52am
closed account (1vf9z8AR)
Please tell me the shortest code to make a c++ run itself at startup.
Jan 2, 2018 at 11:28am
There is not an easy cross platform way I believe, but for Windows:

You need to mention the compiled executable in the registry (HKLM\...\Run or HKCU\...\Run) or locate the executable in %UserProfile%\AppData\...\Startup.

Using the WinAPI, you can do the first idea through a registry call, but I believe that you need the name the compiled exe will have after compilation. You'll also need it to create a shortcut in the Startup folder to do it the other way.
Jan 2, 2018 at 1:18pm
closed account (1vf9z8AR)
how will i do your first method?
Jan 2, 2018 at 1:30pm
Jan 2, 2018 at 2:12pm
closed account (1vf9z8AR)
but i need in such a way that the program itself copies itself onto a folder without the user doing anything.
Last edited on Jan 2, 2018 at 2:13pm
Topic archived. No new replies allowed.