How do I run Visual Studio as an administrator by default?

.NetVisual StudioVisual Studio-2010Installation

.Net Problem Overview


I recently discovered that even while logged into my personal laptop as an administrator, Visual Studio does not run in administrator mode and you need to explicitly use Run As Administrator.

Is there a way to make it run as an administrator by default, other than creating a shortcut, etc.?

.Net Solutions


Solution 1 - .Net

Copied and pasted from here, the Using Advanced Properties section. This will allow you to always have the program run as an administrator when you open it.

Windows 7:

  1. Right click on the shortcut of the program, then click on Properties.
  2. Click on the Shortcut tab for a program shortcut, then click on the Advanced button.
  3. Check the 'Run as administrator' box, and click on OK.
  4. Click on OK.
  5. Open the program.
  6. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an Administrator.

NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.

Update: (2015-07-05)

Windows 8, 8.1 and 10

In Windows 8, you have to right-click devenv.exe and select "Troubleshoot compatibility".

  1. Select "Troubleshoot program"

  2. Check "The program requires additional permissions" click "Next", click "Test the program..."

  3. Wait for the program to launch

  4. Click "Next"

  5. Select "Yes, save these settings for this program"

  6. Click "Close"

Update reference original Link

Solution 2 - .Net

Try the following steps on Windows 10:

  • Search for Visual Studio on the Start window and select "Open file location":

enter image description here

  • Select "Troubleshoot compatibility" :

trouble shoot

  • Select "troubleshoot program":

tobleshoot

  • Raise permissions:

raise permissions

  • Select "Yes, save these settings for this program"

  • Select "Close"

Once that is done, Visual Studio should be running as administrator.

Solution 3 - .Net

Right click on the application, Props -> Compatibility -> Check the Run the program as administrator

Solution 4 - .Net

Applying this change will make it so that when you double click on a .sln file Visual Studio will not open. Also, you will not be able to drag and drop files into Visual Studio.

Follow the numbered instructions for each file in the bullited list. The paths are for a standard 64-bit install so you may have to adjust them for your system.

  • C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VSLauncher.exe
  • C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
  • C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
  1. Right click on the file and select Properties
  2. Select the Compatibility tab
  3. Optional: Select Change settings for all users
  4. Select Run this program as an administrator
  5. Select Ok and close the dialog

Solution 5 - .Net

Windows 10

  1. Right click "Visual Studio" and select "Open file location [![Right click "Visual Studio" and select "Open file location"][1]][1] [1]: http://i.stack.imgur.com/7MesY.png

  2. Right click "Visual Studio" and select "Properties" [![Right click "Visual Studio" and select "Properties"][2]][2] [2]: http://i.stack.imgur.com/lA9q6.png

  3. Click "Advanced" and check "Run as administrator" [![Click "Advanced" and check "Run as administrator"][3]][3] [3]: http://i.stack.imgur.com/bQTu1.png

Solution 6 - .Net

image showing how to run visual studio as adminstrator by mhamri step 1 to 3

1- either from start menu or when visual studio is open in the task bar, right click on the VS icon

2- in the context menu, right click again on the visual studio icon

3- left click on prorperties

image showing how to run visual studio as adminstrator by mhamri step 4

4- choose advanced

image showing how to run visual studio as adminstrator by mhamri step 5

5- choose Run as Administrator

click ok all the windows, close the visual studio and reopen again.

Solution 7 - .Net

windows 8

there is no advanced tab anymore. So, to do it automatically, you need to follow the next steps :

-right click on the shortcut
-click on properties
-under the "Shortcut" tab, click on "Open File Location"
-then, right click on devenv.exe
-Troubleshoot compatibility
-Troubleshoot program
-Check "The program requires additional permissions"
-Then next, next next,...

Solution 8 - .Net

Follow these simple steps:

  1. Right Click on "devenv.exe"
  2. Click "Troubleshoot compatibility"
  3. Click "Troubleshoot program" Check "The program requires additional permissions"
  4. Click "Next"
  5. Click "Test the program...". It should launch Visual Studio as Administrator
  6. Click "Next"
  7. Click "Yes, save these settings for this program"
  8. Click "Close the troubleshooter"
  9. Now the Visual Studio will always run as Administrator.

Solution 9 - .Net

In Windows 10 do the following steps:

  • Download and install the 'Everything' application that locates files and folders by name instantly.
  • Find the 'devenv.exe' and locate it.

Everything

  • Right-click on 'devenv.exe' and select "Troubleshoot compatibility". Then select "Troubleshoot program". Then check "The program requires additional permissions". Then test the setting and save setting in next page.

Troubleshoot compatibility

Troubleshoot program

The program requires additional permissions

Run As admin

Solution 10 - .Net

One time fix :

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe"="~ RUNASADMIN"

Solution 11 - .Net

Right-click the icon, then click Properties. In the properties window, go to the Compatibility tab. There should be a checkbox labeled "Run this program as an administrator." Check that, then click OK. The next time you run the application from that shortcut, it will automatically run as the admin.

Solution 12 - .Net

Right click on icon --> Properties --> Advanced --> Check checkbox run as Administrator and everytime it will open under Admin Mode (Same for Windows 8)

Solution 13 - .Net

For Windows 8

  1. right click on the shortcut
  2. click on properties
  3. click on the "Shortcut" tab
  4. click on Advanced

You will find Run As administrator (Checkbox)

Solution 14 - .Net

There are two ways to Run Visual Studio as Administrator:

1. Only 1 time: For this go to startup search bar, search for Visual studio 2017 or what ever version you have, then Right click on VS and Run as Administrator.

2. Permanent or Always: For this go to startup search bar, search for visual studio, right click to it and go to properties. In the properties click on advanced button and check the Run as Administrator check box and then click on ok.

Solution 15 - .Net

@Kumar

"W7 prompts everytime to run this program "devenv.exe" , anyway to get rid of that ?"

Yes. You can prevent Windows from prompting you by going to Control Panel/User Accounts/Change User Account Control settings and move the slider down.

Solution 16 - .Net

In addition to the above suggestion, to setup admin rights for Visual Studio, if you still get the following intermediate prompt; enter image description here

You will have also to click on Show more details or go to Control Panel Security and Maintenance and click on Change User Account Control Settings;

enter image description here

and choose Never Notify:

enter image description here

Solution 17 - .Net

I have always done it by creating a shortcut, which is not really much of a problem. I believe there is no way of doing it otherwise.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKumarView Question on Stackoverflow
Solution 1 - .Nethamid reza mansouriView Answer on Stackoverflow
Solution 2 - .NetTshilidzi MudauView Answer on Stackoverflow
Solution 3 - .NetMatan ShaharView Answer on Stackoverflow
Solution 4 - .NetNateView Answer on Stackoverflow
Solution 5 - .NetJsen FrugeView Answer on Stackoverflow
Solution 6 - .NetMohammad Hossein AmriView Answer on Stackoverflow
Solution 7 - .NetDeblaton Jean-PhilippeView Answer on Stackoverflow
Solution 8 - .NetHadi SalehyView Answer on Stackoverflow
Solution 9 - .NetBehzad EbrahimiView Answer on Stackoverflow
Solution 10 - .NetEfe ÖZYERView Answer on Stackoverflow
Solution 11 - .NetScott 混合理论View Answer on Stackoverflow
Solution 12 - .NetcodingpirateView Answer on Stackoverflow
Solution 13 - .NetMohm4zView Answer on Stackoverflow
Solution 14 - .NetAdeel KamranView Answer on Stackoverflow
Solution 15 - .NetcameronjchurchView Answer on Stackoverflow
Solution 16 - .NetIron MaskView Answer on Stackoverflow
Solution 17 - .NetSchroedingers CatView Answer on Stackoverflow