the auto exec page
There are few things that eventually can be added. The registry keys that can start a program at the start are (here's the doc https://learn.microsoft.com/en-us/windo ... istry-keys):
on machine level:
for the current user:
All of them are managed by RunOnce.exe. The RunOnce keys are more interesting as the RunOnce.exe deletes the values from the registry once the program is ran. The more interesting thing in RunOnce keys is that you can run them in safe mode!!
The command should be prefixed with asterix.
To prevent deletion you can use exclamation (I don't know if the asterix and exclamation can be combined). For all of them limit is 260 chars.
There are also two start up folders - one for the current user and one for the whole machine:
And with task scheduler - the command line gives more control (though this is covered in the SCHTASKS page):
SCHTASKS /Create /SC ONEVENT /MO ONLOGON /TN ON_LOGON /tr "c:\some.bat"
SCHTASKS /Create /SC ONEVENT /MO ONSTART/TN ON_START /tr "c:\some.bat"
Its possible also to be added data on how to execute scripts on shutdown or logoff - by handling events with SCHTASKS or through registry entries.