Reputation: 11319
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.?
Upvotes: 581
Views: 397164
Reputation: 429
Adding one more solution that doesn't require modifying the app link, works for enterprise and standalone machines, with or without UAC, and best of all - it works on a per-solution or per-project basis.
VSLauncherX A (open source) tool that serves as a launcher for Visual Studio and can be configured for each solution or project independently. Supports specific VS version per solution, multi monitor, launching multiple VS instances at once, admin mode, pre- and post-launch commands, GIT status and much more.
Upvotes: 0
Reputation: 9614
To open Visual Studio or Rider, always in admin mode, follow the steps below (works for WINDOWS 11)
It works even if you double-click a *.sln
file to open.
Upvotes: 11
Reputation: 11313
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.
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.
Upvotes: 981
Reputation: 1
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;
and choose Never Notify:
Upvotes: -1
Reputation: 1985
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
4- choose advanced
5- choose Run as Administrator
click ok all the windows, close the visual studio and reopen again.
Upvotes: 25
Reputation: 1026
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.
Upvotes: 21
Reputation: 7869
Try the following steps on Windows 10:
Search for Visual Studio on the Start window and select "Open file location":
Select "Troubleshoot compatibility" :
Select "troubleshoot program":
Select "Yes, save these settings for this program"
Select "Close"
Once that is done, Visual Studio should be running as administrator.
Upvotes: 262
Reputation: 162
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.
Upvotes: 1
Reputation: 2332
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.
Upvotes: 4
Reputation: 411
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"
Upvotes: 14
Reputation: 11388
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,...
Upvotes: 19
Reputation: 579
Upvotes: 45
Reputation: 360
Follow these simple steps:
Upvotes: 22
Reputation: 13242
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
Properties
Compatibility
tabChange settings for all users
Run this program as an administrator
Upvotes: 42
Reputation: 9
For Windows 8
You will find Run As administrator (Checkbox)
Upvotes: 0
Reputation: 1414
Right click on icon --> Properties --> Advanced --> Check checkbox run as Administrator and everytime it will open under Admin Mode (Same for Windows 8)
Upvotes: 4
Reputation: 410
@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.
Upvotes: -1
Reputation: 3240
Right click on the application, Props -> Compatibility -> Check the Run the program as administrator
Upvotes: 57
Reputation: 3129
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.
Upvotes: -4