c++ program open at startup

closed account (1vf9z8AR)
Please tell me the shortest code to make a c++ run itself at startup.
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.
closed account (1vf9z8AR)
how will i do your first method?
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
Topic archived. No new replies allowed.