Disable Vista UAC per-application, or elevate privileges without prompt?

谁说我不能喝 提交于 2019-11-30 10:09:34

Generally this problem solved by installing a Windows Service which runs as SYSTEM or an admin account. Then your application can request the privileged action from this service.

Obviously to not pose a security threat ensure that your service can't run arbitrary code or something which might leave the all users vulnerable to privilege escalation attacks.

Winpcap and most of the other sniffing applications use a similar design to give sniffing access to unprivileged users.

Actually, why don't you just create a Task Schedule which runs the app with elevated privileges? As long as you setup the Task under elevation, it will not prompts you for a UAC when it is auto-run during reboot or whatever your trigger is.

Just make sure you set level=requireElevation in your manifest file, and task scheduler will run your app with admin rights without prompting your user for admin rights, as this had already been established when you setup the task with admin privileges.

It's not possible. You cannot decide to suppress UAC prompt.

You have to ask yourself:

What would happen on Windows XP?

The user is a standard user on Windows XP, and the application "needs" to run as an administrator. Are you:

  • going to refuse to run?
  • going to crash on startup?
  • going to show the user access denied error messages?

If the user is simply not allowed to run the application as a standard user on Windows XP, then UAC is your friend: it tells the user that they have to be an administrator.

And it even offers to let them (temporarily) gain administrative privileges.

But you have to ask yourself:

What would happen on Windows Vista?

In order to elevate, the user will need someone from IT to walk from three buildings over, so they can type in their credentials "over the shoulder". Perhaps you can make the user's life easier. Let 99.9% of the application run, and split off that 0.01% to an "administrative" module.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!