Seeing how the only way around this seems to work like another user; the work I set up is to change all my shortcuts on devenv.exe to:
C:\Windows\System32\runas.exe /user:VisualStudio /savecred "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"
And I stopped the .sln files from opening directly with visual studio and sent them through a batch file that uses a python script to format and execute the runas command.
So .sln files open with vs .bat:
C:\Python33\py\vs.py %1 %2 %3 %4 %5 %6 %7 %8 %9
With vs .py runs:
#python 3.3.0 import sys import subprocess count=0; command = "runas /user:VisualStudio /savecred \"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" for arg in sys.argv: # Ignore first arg - its this file if(count > 0): command = command + " \\\""+arg+"\\\"" count = count + 1 command = command + "\"" print("") print(command) subprocess.Popen(command)
Creates a correctly formatted launch as a command and launches a visual studio for the VisualStudio user.
The biggest downside of this so far is that the .sln files attached to the visual studio icon in the taskbar / start menu still run under my account; and I canβt find a way around this.
Jonathann
source share