How to trick UAC in Vista and Windows 7? How can I run something that needs not just administrator rights, but especially must be told to run as Administrator. I've tried start a process with given admin credentials, and even tried to use win32 function CreateProcessAsUser, but still unless I tell it manually "run as Administrator" it doesn't run with fully administrator privileges. How. How in the world I suppose to run that silently without that damn stupid UAC dialog?
Asked
Active
Viewed 4,242 times
0
-
Are you asking about doing this programmatically? I'm not trying to be a jerk, but from your wording, I am honestly unsure. If you are not, this question is more suitable for Super User than Stack Overflow. – Pops Jul 08 '10 at 16:48
-
@Lord Torgamus, he meantions CreateProcessAsUser which sounds programmatic to me. He could be a lot more detailed though. – Samuel Neff Jul 08 '10 at 16:50
-
@Sam Thanks for support. I'm trying to start a process from my code and that process needs full Administrator rights. But I work on my machine and I already have Administrator rights, still that damn thing needs to be manually instructed to "run as Administrator". I need to run that silently. – iLemming Jul 08 '10 at 17:50
-
possible duplicate of [In Windows: How do you programatically launch a process in administrator mode under another user context?](http://stackoverflow.com/questions/21716527/in-windows-how-do-you-programatically-launch-a-process-in-administrator-mode-un) – Harry Johnston May 14 '14 at 20:38
1 Answers
1
You need to install it as service. It will run as SYSTEM which has full admin rights. There are some hooks you need to create in your app to respond to start stop and restart events.
If you don't' care if the program needs to respond to the service events, you can just use SC.exe or Srvinstw.exe to install any executable as a service.\
Edit I don't think you can do this. To have a exe run with elevated rights, it has to be digitally signed by microsoft. You might be able to use a trick to make your executable a DLL and run it with rundll32.exe (Which has elevated permissions & signed by MS). I don't think Microsoft wants anything to run silently when UAC is turned on.

Byron Whitlock
- 52,691
- 28
- 123
- 168