In Windows 7, you can set a property of a shortcut to "Run as Administrator", so that the application is invoked with Administrator privileges or the user is asked for an admin account.
I know I can request/force Administrator privileges with a manifest file for my application, but I need to set the privileges for applications that are not mine. As Installer Software I use SetUp Factory 8. It will create a shortcut but doesn't set "Run as Administrator".
So far I set the option with every customer manually after install but that is a lot of work.
How can I set "Run as Administrator" for application shortcuts via a program/script (like editing the shortcut) or in any other way.
By default, items in Windows Start Menu do not have a “Run As” option. In order to add the “Run as different user” option, enable the “Show Run as different user command on Start” policy in User Configuration -> Administrative Templates ->Start Menu and Taskbar section of the Local Group Policy Editor (gpedit. msc).
Right-click the app and choose Properties in the context menu. In the Properties window, switch to the Compatibility tab at the top. Here, toggle the option that says Run this program as an administrator. Click OK to save your changes and close the Properties window.
You know that you can embed a manifest, but it seems like you don't know you can also have an external manifest. You don't need to compile the executable for this. Just name the file whatever.exe.manifest and put it in the same folder as whatever.exe. If that manifest says requireAdministrator, you'll request elevation on every run. Have your installer copy the manifest wherever it copies the exe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With