0

Is there a way to ensure that all pinned solutions from Visual Studio 2017 always start visual studio 2017 in admin mode?

I have checked the other related answers to this question and all relate to either earlier versions of Windows 10 (registry entries missing now, etc.) or earlier versions of Windows itself. I have yet to see this addressed in the Creator version (v 1703) of Windows 10.

If there is, will you please share it as I am used to having that feature "just work" and now it fails.

What is of particular annoyance is that Visual Studio 2017 (v15.3) will start in admin mode every time! Just the pinned solutions fail to do so.

In particular, is there a group policy setting that I am not aware of that needs tweaking? I should clarify and say that this does work on the old home box (which is NOT part of a domain) but does not work on the work machine, which IS part of a domain. <== This is the part that makes this different from the standard answers.

At the time I posted this, I did not have access to the standard methods (attempting to change the status of devenv flat failed due to a lack of the "run as administrator" option and trying to change vslauncher gave me a security violation. I spoke with the DevOps guys, found out they were "fiddling" with things (we just moved to Win10 not too long ago) which caused my original problem. The follow up of being able to launch VS as admin just fine but not a pinned solution from the start bar had them going for awhile, just as one of their mods prevented one of my colleagues from starting multiple copies of VS, admin or not - made no difference, he got one copy and that was it. They have relaxed the rules quite a bit now, thus the supplied solution worked for my environment.

Fred
  • 101
  • 3
  • 1
    Possible duplicate of [How to always launch vs.net as administrator](https://superuser.com/questions/23462/how-to-always-launch-vs-net-as-administrator) – Ramhound Sep 20 '17 at 15:09
  • Related: [Always start Visual Studio as an Administrator on Windows 8](https://superuser.com/questions/462912/always-start-visual-studio-as-an-administrator-on-windows-8/486589#486589), [No compatibility tab for Devenv.exe (VS 2010 and VS 2012) on Windows 8](https://superuser.com/questions/465065/no-compatibility-tab-for-devenv-exe-vs-2010-and-vs-2012-on-windows-8/486586#486586) – Ramhound Sep 20 '17 at 15:12
  • Look a little more closely - this is in a domain controlled environment and my options are limited as to what I can change. My primary interest was in finding something I can give the OPS guys so they can consider relaxing the restrictions on our environments. As it turns out, the registry hack does the trick. – Fred Sep 21 '17 at 07:32
  • Didn't think I had to. Shouldn't have made any difference anyway - still needed a solution regardless of whether it would be applied by an administrator or a regular user. What was needed was the fix to be applied, either by an admin e.g. "Do this..." or the regular user told "Get your administrator to do this...". Either way, what was needed was the fix – Fred Sep 21 '17 at 15:37

1 Answers1

0

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe=^ RUNASADMIN
C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe=^ RUNASADMIN

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe=^ RUNASADMIN
C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe=^ RUNASADMIN

Do note that one must adapt for one's version of visual studio - the supplied answer is for the "Professional" version, if you have a different version, e.g. Enterprise, just change that part of the path (e.g. \Professional\) and it should be OK.

Fred
  • 101
  • 3
  • Not particularly interested in "votes" and given that this particular post achieved "Tumbleweed" status from the lack of views, I wasn't too concerned about the content. When I last checked, only 3 views were listed and I chalked those up to me. I put this answer up mainly as a found answer for those that are in a domain-controlled environment as a possible solution to offer the DevOps guys. However, I will agree that I shouldn't have been lazy just because I presumed I was the only one that would ever see it. – Fred Sep 21 '17 at 07:52