Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

Screenshot of scheduled task trigger
Click for full size

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.

Screenshot of scheduled task user
Click for full size

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.

share|improve this answer
    
Make sure you specify that it is for every user. This will require admin username and password when scheduling the task, but the user will not have access to the password, so no worries. –  ekaj Apr 28 '12 at 20:12
1  
At startup has no concept of users, it runs before logon. At logon does care and does have that option, but that's not the question. –  Bob Apr 28 '12 at 20:14
    
Wasn't aware you could run programs on startup, does that mean before the user logs in? Because that kind of seems like a security issue. –  ekaj Apr 28 '12 at 20:18
1  
Yes, before users log in. However, I was mistaken. It appears (see the edit) that you still have to specify the user to run as, though not run for. –  Bob Apr 28 '12 at 20:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.