Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top