How would one go about causing an .exe to run when a Windows system boots, and leave the .exe running regardless of who is logged in? Is this possible?
Asked
Active
Viewed 1.3k times
1 Answers
2
As per this Sysinternals forum post, the most reliable way to do so is to add a scheduled task. Simply define a trigger At startup. It will keep running until it is forcibly terminated, e.g. by a crash or the user killing the process. A standard/limited user can't see or kill processes they do not own.
You also have to set the task to Run whether user is logged on or not, and probably should run as an Administrator account, with highest privileges. You can even run as the SYSTEM account.
This is distinct from the At logon trigger.
If you wanted to do this programatically (i.e. make your program add itself to system startup), the best way would be to create a Windows service.
Bob
- 61,637


At startuphas no concept of users, it runs before logon.At logondoes care and does have that option, but that's not the question. – Bob Apr 28 '12 at 20:14