DCSIMG
"Run as Administrator" - Run an application in Vista with Administrator rights using app.manifest - Client-Side with Basil Goldman

"Run as Administrator" - Run an application in Vista with Administrator rights using app.manifest

With the new version of Microsoft's Windows Vista - you and me as a software developer confronted with the problem of "How to run the application with Administrative rights under VISTA - a decision use app.manifest file with follow configurations.

Just add new item "Application Manifest File" into your project and replace all to this one. (See below)

<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" >
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="someExecName"
type="win32" />
<description>Program description</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>


Enjoy...

 

Comments

# Neelakandan said:

Excellent Post. Thank you so much.

Tuesday, April 28, 2009 1:02 PM
# Jeroen said:

Cheers, was looking for exactly this.

Wednesday, December 09, 2009 5:39 PM
# Dan M said:

This doesn't work for OneClick applications. Upon running Setup.exe users will see "Execution level requested by this application is not supported". According to a post in MSDN forums this isn't supported.  That is so frustrating to me because I'm updating our Test Tool that needs to modify the hosts file for tests to run properly.

Thursday, September 30, 2010 9:39 PM

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: