Is there any way to autorun an exe when windows boots up, but before user logs in? One of the options is register a windows service, however sometimes this is not possible. I'm looking for sth like a registry key (HKCU\Software\Windows\CurrentVersion\Run).

link|improve this question
1  
As the most obvious use for this capability is to enable malware, it might help if you could explain your application in a little more detail. – John R. Strohm Feb 5 '10 at 15:33
HKLM instead of HKCU (assuming you have the rights to amend this key) – AdamV May 20 '10 at 21:52
feedback

migrated from stackoverflow.com Feb 6 '10 at 3:57

This question came from our site for professional and enthusiast programmers.

3 Answers

You can actually turn pretty much any program to a Windows Service. See NSSM - the Non-Sucking Service Manager.

link|improve this answer
Sorry, I can, however I cannot register windows service for various reasons. – aloneguid Feb 4 '10 at 12:13
feedback

Scheduled Tasks allows you to create a task that runs when the computer starts.

You can either follow the instructions in the Microsoft KB to create a scheduled task through the GUI, or you can run a command similar to this:

schtasks /create /tn MyTask /tr C:\MyApp\MyApp.exe /sc ONSTART /ru username /rp *
link|improve this answer
feedback

Just make a batch file to run the program and insert it into the standard startup scripts:

  • Navigate to Start -> Run and type gpedit.msc then press Enter
  • Under Computer Configuration -> Windows Settings open Scripts(Startup/Shutdown)
  • Double-click "Startup" in right pane.
  • Click Add and browse to your script and then click OK
link|improve this answer
How is this offensive? – Ivo Flipse Jun 17 '10 at 7:05
feedback

Your Answer

 
or
required, but never shown

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