The Linux Page

Register an application so it automatically starts on reboot

Always wondered how they automatically restart an application after a reboot under MS-Windows?

There is a function named RegisterApplicationRestart() that does just that.

There are flags to tell when your application should be started or under which circumstances.

For instance, you can start only if something crashed the OS.

The doc is here: https://learn.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-registerapplicationrestart