PDA

View Full Version : "Run as administrator" shortcut option



NewsArchive
03-22-2011, 01:38 AM
Hi,

The Shortcut creation function lacks the "run as administrator" option. How
can I handle this situation in Windows 7?

Thanks for your help,

Jay

NewsArchive
03-22-2011, 01:38 AM
Jay,

> The Shortcut creation function lacks the "run as administrator" option.
> How can I handle this situation in Windows 7?

First of all, the "Run as Administrator" attribute is not an attribute of
the Shortcut itself! The "execution level" is something that your own
application .exe has to request via a manifest.

You can use the "#embed UAC manifest..." compiler directive in SetupBuilder
to specify the minimum execution level required by your application for
running on Windows Vista, Windows Server 2008 or Windows 7 platforms. The
SetupBuilder compiler embeds a Windows UAC-aware application manifest in
your application. This manifest specifies the selected execution level and
can therefore include the necessary requestedExecutionLevel attributes,
allowing the application to run with the desired privilege level on Windows
Vista, Windows Server 2008, Windows 7 and Windows Server 2008 R2. Operating
systems earlier than Windows Vista ignore the required execution level.

SetupBuilder provides the capability to automatically embed an XML
application manifest file within the resource section of a Portable
Executable (PE) image. When the program is launched, the application
manifest information will be extracted from the resource section of the PE
and used by the operating system.

But if you can't (for whatever reason) make your application UAC-aware, you
can use the "Set App Compatibility Mode..." script function to modify the
"Program compatibility" settings for your application and set the "Run this
program as an administrator" checkbox option. Program compatibility is a
mode in Windows that lets you run programs written for earlier versions of
Windows. If you have a problem with an application that worked on an
earlier version of Windows, the "Set App Compatibility Mode" function lets
you select the compatibility mode that matches that earlier version. But
this should only be a temporary solution until you find a way to make your
software UAC-aware.

Hope this helps.

Friedrich

NewsArchive
03-22-2011, 01:39 AM
Hi Friedrich,

All points well taken and thank you very much for the info!

Jay