From Getting Visual Studio 2010 SP1 to run elevated when launching .sln files :
After some research, I found that the
reason for Windows ignoring my
compatibility setting was that
VSLauncher.exe now had a manifest
embedded, which contained the
following fragment:
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false">
</requestedExecutionLevel>
</requestedPrivileges>
So, VSLauncher.exe now specified that
it always wanted to be run at the same
execution level as its invoker. And,
since of course the program must know
better than the user, this caused
Windows to ignore my own execution
level setting.
And now, to the solution. Since
Windows wouldn’t let me override what
the program said it wanted, I needed
to override what the program said it
wanted.
To do that, I used the Manifest Tool
that comes with the Windows SDK (and
thus with Visual Studio):
mt -inputresource:"VSLauncher.exe" -out:VSLauncher.exe.manifest
This command extracted the manifest
from VSLauncher.exe into a file called
VSLauncher.exe.manifest. I then edited
the manifest to request the desired
execution level:
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false">
</requestedExecutionLevel>
</requestedPrivileges>
Then, I could write back the manifest:
mt -outputresource:VSLauncher.exe -manifest VSLauncher.exe.manifest
With the desired result.
One note of caution: Please make a
backup copy of VSLauncher.exe before
manipulating the manifest.
And perform
at your own risk.