2

I have a corporate computer where I am not able to alter some essential global environment variables like HOMEDRIVE, HOMEPATH and HOMESHARE due to group policies.

I am using a couple of tools integrated with Visual Studio - e.g. Git - that uses these variables and this slows the tools down considerably.

I am able to overcome this by locally setting the above environment variables to local drive in a cmd prompt and starting devenv from the same prompt. Everything works fine and fast.

This however does not work when opening a solution file by double clicking, or when the solution is opened by another tool.

So my questen is: How can I set environment variables that visual studio will use every time it opens, regardless how it is opened?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Generic Name
  • 1,083
  • 1
  • 12
  • 19
  • Are you a local admin (or have access to a local admin account)? – Richard Sep 09 '15 at 09:10
  • Not sure if it'll work, but you could try changing `C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat` to set the variables in there. Or stick a batch file in your Windows Startup folder and call `setx` to globally override the variables after boot. http://stackoverflow.com/a/5898197/736079 – jessehouwing Sep 09 '15 at 09:14
  • setx does not work for these variables. Works for other variables though. I suspect this has to do with the group policy. I am using vs 2012, 13, and 15. And yes I am local admin. – Generic Name Sep 09 '15 at 09:26
  • Check my solution here: this may help you! https://stackoverflow.com/questions/66050116/set-proper-environment-path-variables-for-visual-studio – Rohit gupta Feb 04 '21 at 19:00

0 Answers0