Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question

migrated from Feb 6 '10 at 3:57

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

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

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

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

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
share|improve this answer
How is this offensive? – Ivo Flipse Jun 17 '10 at 7:05

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 *
share|improve this answer

Your Answer


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.