Visual Studio Run as administrator shortcut - visual-studio-2010

how do I create a shortcut that runs Visual Studio with Administrator rights?
Actually I have to navigate to the Visual Studio start menu folder, click on the icon with the right mous button and choose "Run as Administrator".

Right-click on the shortcut, select Properties. On the Shortcut tab, click the Advanced button (bottom right). Check the Run As Administrator box.

I know the OP was about how to create a shortcut that runs VS as admin, but using the steps below you can just always have VS launch as admin.
This is a copy of my answer to a similar post on SuperUser:
Option 1 - Set VSLauncher.exe and DevEnv.exe to always run as admin
To have Visual Studio always run as admin when opening any .sln file:
Navigate to C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe.
Right-click on VSLauncher.exe and choose Troubleshoot compatibility.
Choose Troubleshoot program.
Check off The program requires additional permissions and hit Next.
Click the Test the program... button to launch VS.
Click Next, then hit Yes, save these settings for this program, and then the close buton.
To have Visual Studio always run as an admin when just opening visual studio directly, do the same thing to the DevEnv.exe file(s). These file are located at:
Visual Studio 2010
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Visual Studio 2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
Visual Studio 2013
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
Visual Studio 2015
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Option 2 - Use VSCommands extension for Visual Studio
Install the free VSCommands extension for Visual Studio (it's in the Visual Studio Extensions Gallery) and then configure it to always have Visual Studio start with admin privileges by going to Tools -> VSCommands -> Options -> IDE Enhancements -> General and check off Always start Visual Studio with elevated permissions and click the Save button.
Note: VSCommands is not currently available for VS 2015, but their site says they are working on updating it to support VS 2015.
My Opinion
I prefer Option 2 because:
it also allows you to easily turn off this functionality.
VSCommands comes with lots of other great features so I always have it installed anyways.
it's just easier to do than option 1.

What I was looking for was a way of running Visual Studio Solution files (.sln) as Administrator. I just found a pretty good way of doing this...
Place this content inside a file named RunAsAdministrator.reg:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\runas\Command]
#="\"C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe\" \"%1\""
Double click the file to execute it.
Now, when you right click a file you'll have the option of running it as Adminstrator like this:
Here's the full story by the AWESOME David Ebbo: Open your solution files as admin

Create a shortcut to Visual Studio on your desktop
Right-click on the program
"Send to"
"Desktop (create shortcut)"
Open up properties
Right-click on the shortcut
"Properties"
Within the "Shortcut" tab, click on "Advanced..." (somewhat towards bottom right)
Select "Run as administrator" in the new window
Apply and OK all the windows.
Now when you use this shortcut, it should run the program as administrator.

The above answers works, but on Windows 10 you might bump with disabled advanced shortcut screen. So for windows 10 do the following:
Create shortcut to the solution file
Right click the shortcut => properties
Choose Shortcut tab
Under Target add the visual studio executable location before the sln path. For example:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" C:\mypath\example\example.sln
Press Advanced under the shortcut tab - you'll be able to edit the advances window.
Select "Run as administrator"
Press ok
Double click the shortcut - you should be able to run the solution as administrator now.

Ctrl + Shift + Clicking on Visual Studio 2019 shortcut seems to open Visual Studio Professional 2019 in admin mode.

Related

Visual studio 2015 missing start menu icons Windows 8

We are currently trying to deploy Visual studio 2015 Professional across our school in a windows 8 domain environment. Visual studio installs fine but its shortcut are missing from the start menu. and the search feature does not find visual studio. The program can be ran directly.
I have found some of the shortcuts in: "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio Tools" however these are only for the command prompt tools and not for visual studio itself.
Is there anywhere else the shortcuts may be?
I found the same thing happened with my installation under Windows 7
Instead of the shortcuts being inside the Visual Studio 2015 start menu programs directory, I found them one level up in the parent directory - somewhere I did not expect them to be.
As it turns out our domain has a script that deletes any shortcuts not in a sub folder - That would explain why the shortcuts are disappearing!
We have added a line to our install script to place the shortcut in the sub directory.
The installation move the shortcut for visual studio 2015 outside the 2015 folder to be consistent with other Microsoft applications.
Type: Windows key to use "Search for programs and files", type "Visual Studio" to open VS quickly.
or
Type: Windows key , click All programs, then click "visual studio 2015"

TFS compare (from windows explorer) opens file in older version of Visual Studio

When I right click on a file in windows explorer, and choose TFS > Compare > With Latest Version, it opens up visual studio 2012. How can I get it to open it with Visual Studio 2013?
I do not have a side-by-side installation at the moment. I would check:
The installed Explorer TFS Menu Handler. (nice tool for this: Autoruns - sysinternals.com)
The environment variables PATH and TFSPowerToolDir.
Related Registry entries.

How to open visual studio without administrator rights

When i open visual studio 2010 it is automatically running with administrator.
Let me know how can i open visual studio without administrator rights.
Any ideas on how to fix this?
This solution should only be used if Flabetvibes solution does not work.
Navigate to the Visual Studio install folder (commonly C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\)
Right-click devenv.exe > Properties
Go to the Security tab and click Advanced button.
Click on Change right beside the owner (the current owner may be "Administrators").
Enter your Windows user name into the text area and click Check Names.
If found, click OK and Apply etc.
Visual Studio should now start in normal mode (without "Administrator").
This has to be repeated every time a new update is installed.
I supposed you are running Visual Studio 2010 under a Windows system, then the solution might be:
Right click on the Visual Studio icon
Choose Properties
Select the Compatibility tab
Unchecked Run this program as an administrator inside the Privilege Level group box
Hope this idea is useful.

Project needs to be opened by Visual Studio 2008 by default in Windows 8

I have installed visual studio 2008 and 2010 and also vs 2012 on windows 8. Now if I open a vs 2008 project, it asks me to convert it to vs 2010 which I don't want.
In windows 8 I tried "open with" but I can't see vs 2008 in programs, when i go to it's destination and try to open it, it opens up as VS 2010 again.
Update
Problem isn't that i can't open projects with VS 2008, problem is I am not able to force a VS 2008 solution to be opened by VS 2008 (by default).
I can open the project by opening VS 2008 and then use file -> Open
These projects are in SVN Tortoise Repository, on windows 7 they open by VS 2008 by default but now I got windows 8 so each time I open project, it asks me for this,
Sorry for confusion.
Not sure why it's working the way it use to work in Windows 7 but I will look it into it, however I am able to fix the problem by,
I think problem came up because I installed VS 2012 and VS 2010 first and then installed VS 2008 at end.
I am experienced something similar.
Windows 8.1 with VS2008 and VS2013 installed.
Problem:
Right mouse select a VS2008 .sln file in File manager.
Select "Open with..." from the menu
The dialog shows one choice, VS2013.
From the "How do you want to open this file?" dialog, select "More Options"
Scroll down past all the new choices and select "Look for another app on this PC"
Paste in the path to VS2008. Example: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
It runs VS2013 instead.
Also, using "File->Properties" to associate the .sln file with VS2008 did not work as I expected. After setting the file association, I expected the be able to double click on that .sln file and bring up VS2008 but it ran VS2013 instead.
Solution:
After using "File->Properties" to attempt to associate the .sln file with VS2008 something has changed.
Now when I attempt step 2 ("Open with..") I get 2 choices: VS2013 and "Visual Studio Version Selector". Selecting "Version Selector" with "Use the App for all .sln files" checked will cause subsequent .sln files to be opened with the correct Visual Studio.

Opening visual studio 2008 in visual studio 2010

I have installed both visual studio 2008 and 2010. When I try to open a visual studio 2008 solution file it opens in visual studio 2010. It does not open in vs 2008.
Select the .sln file in file explorer, right click, select "Open With", select "Visual Studio 2008" or "Visual Studio version Selector".
If it doesn't work, Select the .sln file in file explorer, right click, select "Open With", Select "Choose Default Program" and there you can select Microsoft Visual Studio 2008". It might be hidden if you are OS like vista or Windows 7. There is one line with an arrow to expand all available programs
Hope that helps
Milind
Have you tried opening the project from the file->open menu?

Resources