Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 688
  • Last Modified:

Running an app on Windows with administrative privilages without the confirmation prompt


I use NSIS tool to install my C++ application on Windows. My app is not using Microsoft .NET framework or Visual C++ I want to install it so that it will always run as administrator on Windows and it will not require the UAC promt. But I don't want to turn off the whole UAC. So every time a user launches my app on Windows 7, XP or Vista, there will be no confirmation prompt for administrative privilages, but my app will run with administrator privilages automatically.  

Thank you for help in advance
  • 2
1 Solution
As far as I know this is unfortunately not possible when UAC is turned on (Windows Vista and 7,  Windows XP does not have UAC). It's possible to modify the privilege level of the exe, and select "Run this program as an administrator" for all users
or change the shortcut to the application and select the option "Run as administrator" (Advanced button).
In this way the application will run as an Administrator, however, the user will still get a confirmation prompt.

(if Windows would somehow give this possibility the essence of UAC is probably gone)
tomasCZ1Author Commented:
How does so many programs on Windows can run with administrative privileges without a confirmation prompt?

I appreciate your assistance.
Most of these applications run as a service (services.msc) under the local SYSTEM, Network Service or Local Service accounts. If you can rewrite your application to run as a service and have a sort of frontend for the user which talks to this service this might be an option.

The following links do also contain more info about your question:

These articles describes certain workarounds with e.g. the Task Scheduler or with an external runas program to start programs with Administrative permissions without the UAC prompt.
The Task Scheduler method works because programs can also be executed via the Task Scheduler and started with "Run with highest privileges" without getting an UAC prompt. But when creating such a Task the user account has to be defined so it only works for 1 user.
The runas method, which uses a 3rd party program, needs a user account/passwords and writes this info in an encrypted password file so it's not very secure.
For a normal application this is something you don't prefer to do or might not be possible.

An alternative, for running your application as a service without having to rewrite it, might be http://www.firedaemon.com/
This is commercial software which you can also integrate in your application installation and lets your application run as a service.
Vadim RappCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now