开发者

Is it possible silently run something as Administrator

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 CreateProc开发者_StackOverflowessAsUser, 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜