-1

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!

Community
  • 1
  • 1
andy
  • 8,775
  • 13
  • 77
  • 122
  • In *ix, this would be called setuid root. I don't know how/if this works on Windows. – Matthew Flaschen Nov 01 '10 at 22:15
  • yep, you're right, it is a dupe.... though the other question is still a bit ambiguous maybe...? though it did contain the right answer. Should this question be closed? – andy Nov 02 '10 at 01:09

1 Answers1

1

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

Brad
  • 159,648
  • 54
  • 349
  • 530
  • hey brad, could you just edit out that shortcut thing as it might cause confusion. I'll mark you as the answer, if anyone finds this then they'll follow Has Passants answer. cheers – andy Nov 02 '10 at 01:10