1

Possible Duplicate:
How to run a program automatically as admin on Windows startup?

I've a program written in C++ which requires administrator to run it(it can't be run as user). I'm trying to run this program whenever the user log in, I tried to add a "string" to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

and

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

but it works only with application that doesn't require administrator privileges, it has no effect on my program.

I've managed to solve it by creating a BAT file adding it to the registry, which starts my program.However, it launches the dialog which asks for Admin access. thus we can understand that I can not start it up using this method.

I guess there should be some method, for example an antivirus has administrator privileges. but it could find any thing about it.

Community
  • 1
  • 1
Kirill Kulakov
  • 10,035
  • 9
  • 50
  • 67

1 Answers1

0

Consider using Task scheduler, look here for details:

http://www.techrepublic.com/blog/window-on-windows/make-vista-launch-uac-restricted-programs-at-startup-with-task-scheduler/616

Isso
  • 1,285
  • 11
  • 23
  • I need it to be launched by it self, I don't want the user to be able to cancel the startup. – Kirill Kulakov Apr 04 '12 at 20:00
  • @kirill Tough; the user owns the PC, you don't. Imagine if it was possible to do what you want - can you see how to write a virus that way? – Alan Stokes Apr 04 '12 at 20:27
  • The user can cancel any type of startup - including the one that you mentioned in the original post (just run msconfig), so this solution is equal to any other – Isso Apr 04 '12 at 20:57