How to make the program itself run when you start Windows?

  • Minus, perhaps. A very hazy question and “!!!” with “???” are annoying, and the icon “to the place where the clock” is added by the Shell_NotifyIcon function. - karmadro4
  • What does the icon in the tray? Speech about the startup program. - Nofate
  • @Nofate, the Delphi-Boyan standard , directly from the Paris Chamber of Weights and Measures. - karmadro4
  • ooo, very antique site - Nofate

3 answers 3

Registry.

HKEY_CURRENT_USER\Software\microsoft\windows\currentversion\run\ <- add a string index with a path to your program.

    You can, for example:

    • Create a shortcut in the Startup group of the Start menu.
    • Register in the registry branch HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run or HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run , depending on the task.
    • Make your program a service.

    UPD0. By the way, yes. Thank you @ karmadro4 for reminding. The first two options are rolled only if the user is logged in (this is all related to the winlogon process). For guaranteed auto-start, only service is suitable at system startup.

    • one
      In fact, only the service version satisfies the literal condition of the task. - karmadro4

    Well, since no one has suggested such an option, I will suggest. Create a task in Task Scheduler . As the start trigger, select "When the computer starts" (as I understand it, this is an important condition of the topic-starter), then the task will be completed before winlogon, and as the task itself - the desired program.
    In this case, it is not necessary to make the program a service.