I have a application(which runs on windows7 and requires run as administrative) that need to run automatically when windows starts up, so i added a registry key under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" as usual, but my application won't startup automatically even the UAC dialog doesn't promtp, after search from google. I know i can use task scheduler to workaround this, but is there anyboday can tell me why the "run" registry way doesn't work? why the UAC dialog doesn't promtp? it is better if you can help to find a article from microsoft to explain this issue, many thanks in advance!
Asked
Active
Viewed 2,653 times
1
-
1Mainly because it's obnoxious and intrusive to the user. That should be a good enough reason for anyone. Related: [How to run a program automatically as admin on Windows startup?](http://stackoverflow.com/questions/5427673/how-to-run-a-program-automatically-as-admin-on-windows-startup) – Cody Gray - on strike Dec 28 '11 at 05:35
-
but unfortunately, my manager wants some authoritative explaination from microsoft website,e.g. some article. – user1077127 Dec 28 '11 at 05:41
-
What difference does it make? It doesn't work, you've clearly already tried it. The justification they offer is irrelevant. Time to change your application's design. There's no good reason for this in the first place. – Cody Gray - on strike Dec 28 '11 at 05:45
-
thanks for your reply! but i still need to provide evidence(microsoft article) to him, ╮(╯▽╰)╭ – user1077127 Dec 28 '11 at 05:56
-
3It is a clear usability problem, the user won't have any way to guess why the UAC prompt came up so cannot accurately decide if it is a good idea to allow the program to mess with the private parts. Your manager can get the authoritative explanation from Microsoft Support. – Hans Passant Dec 28 '11 at 17:49
-
Can you clarify your question? You said you need the application to start when _Windows boots_, but `HKLM\Software\Microsoft\Windows\CurrentVersion\Run` applies when _a user logs in_. Which is it? Perhaps you meant `RunServices` rather than `Run`. – Adrian McCarthy Dec 29 '11 at 18:15
2 Answers
6
It is for making the machine usable as quick as possible after booting. Microsoft Whitepaper: Developing Applications that Run at Logon on Windows Vista

Sheng Jiang 蒋晟
- 15,125
- 2
- 28
- 46
1
When Windows starts, there is no user to show the UAC prompt to, so your process would have to be held up until an administrative user logs in.
The Task Scheduler is the right way to do what you want.

Adrian McCarthy
- 45,555
- 16
- 123
- 175
-
-
1Neither "Task Manager" nor "a service" are correct solutions to this problem. – Cody Gray - on strike Dec 29 '11 at 06:32