Visual Studio requires elevated permissions in Windows 7

If you always run Visual Studio as an administrator you are going to get the User Access Control warning every time you start it, even if you are logged in as an administrator to Windows. Obviously you can just click ‘OK’ to dismiss this warning, but it may tempt you to turn User Access Control off.

Note that this is true only if Vista’s User Account Control (UAC) is turned on. Many developers turn UAC off, and in this case Vista behaves in the same way as earlier versions of Windows with regard to starting Visual Studio: if you are logged in as an administrator then Visual Studio will by default run with administrative privileges.

The Administrator Account

Vista also has an account called ‘Administrator’ which behaves differently from other administrator accounts. In fact it behaves like administrator accounts in earlier versions of Windows, in that all programs launched when using it run with administrator privileges by default. There’s no need to specifically set up the program as described above.

As a developer your really shouldn’t need to use this account: you can develop with administrator privileges using the techniques described in this article.

However you may have occasions when you aren’t sure whether a program is failing because of some coding error or simply because a process is being launched with insufficient privileges. In these cases it may be useful to use the Administrator account temporarily to simply rule out a problem with privileges. Note that if you work for a large organization they are almost certainly not going to let you near this account, however: this is really only useful for those developing at home.

Using the Administrator Account

To enable the Administrator account start a command prompt with administrator privileges as described above (type ‘cmd’ in the Start Search box and hit Control-Shift-Enter). Then enter:

net user Administrator /active:yes

This has a blank password by default. To set a password use:

net user Administrator {password}

You can now log off and log on as the Administrator. Once you are done with any testing you should disable this account again as below

net user Administrator /active:no

Note that disabling the account does not clear the password. However if you forget it you can always set it again as above when you come to use the account again (provided you have access to at least one account with administrator privileges).

Hope this helps...

s


Personally (and I don't want to start a religious war on either side here), on any development rig, I always disable UAC. Then, on your test machine, ensure UAC is on and test as normal.

During development, there are an awful lot of tasks which require admin rights, so it's generally easier to just disable UAC.


shortcut Properties -> Compatibility tab -> set Run this program as an administrator checkmark.

[run as administrator]

Shaji in comments posted How to Run a Program as an Administrator in Windows 7 article link.

Most useful(as for me) is to use keyboard shortcut CTRL+Shift while opening the program.