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

前端 未结 3 1533
予麋鹿
予麋鹿 2021-01-01 05:14

I have an app that normal users need to be able to run, but requires administrator privileges to actually function.

I tried to make the shortcut that my users run it

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 06:09

    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.

提交回复
热议问题