0

I have Visual Studio 2017 pinned in the taskbar. I set it to run as an Administrator by right clicking on the icon, then right-clicking on Visual Studio 2017 entry and selecting Properties.

enter image description here

Then clicking Advanced and ticking off the Run as Administrator checkbox.

enter image description here

This works. I click on Visual Studio icon and it run as an administrator.
However, if I click on any of the links under Recent, then Visual Studio doesn't start as an admin.

How do I force Visual Studio 2017 to start as an admin when I select one of the recent links?

enter image description here

1

Those are shortcuts. To make a program always run as administrator find the executable. Find the executable, right click it, select the compatibility tab. At the bottom click run as administrator. Now, any shortcut that points to it shouldn't matter. The application is set up to run as administrator.

For visual studio you can run these registry items or close VS, go to the exe, right click, select troubleshoot compatibility, select troubleshoot program, select this program requires additional permissions, then select test program. Click yes to the question do you want to make changes to this computer. VS will eventually start and if it asks you is it running correctly click yes. It may take a couple min to finish.

Or run these in an elevated command prompt.

reg.exe Add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe" /d "^ RUNASADMIN"

reg.exe Add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" /d "^ RUNASADMIN" 

reg.exe Add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe" /d "^ RUNASADMIN" 

reg.exe Add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" /d "^ RUNASADMIN"
  • There is no Compatibility tab for this program (devenv.exe). – AngryHacker Sep 5 '17 at 17:54
  • Ok. Editing to add for VS – Fixitrod Sep 5 '17 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.