Possible Duplicate:
How to force C# App to run as administrator on Windows 7
hi
sorry about the question title, I really didn’t know how to ask this, and googling failed, probably because I didn’t know how to ask the question!
I know that you can right-click an .exe and then it will require elevated privileges, but I’d like to set this before the .exe is created.
The issue is simply that the bin folder gets recreated, and is not source controlled, and I’d like to have this setting persist somehow.
I’ve heard things about manifest file… but not sure, evidently I’m confused.
thanks for your help!
Check the resource that Hans Passant posted in your comment, as the answer to that question is the correct way to handle this.
If you simply want to make a shortcut that has that “run as administrator” option checked, there is a registry key for it at
HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\layers. Here’s a snippet of code to set this up via NSIS that you should be able to adapt: http://forums.winamp.com/showpost.php?p=2360109&postcount=6