environment variable of visual studio path?

2019-07-16 12:08发布

Thanks for reading this thread.

Basically I am wondering how I can use relative path/environment variable pointing to visual studio 2012 vcvarsall.bat file in a script?

I am currently using absolute path:

call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64

How can I do something like this?

call "$(System)\$(Program Files)$(VS)\$(VC)\vcvarsall.bat" x86_amd64

Thanks a lot.

EDIT

What if I have more than one version of visual studio? I have vs2008 and vs2012 both installed on my computer.

1条回答
Juvenile、少年°
2楼-- · 2019-07-16 13:04

Using a Visual Studio macro VCInstallDir

call $(VCInstallDir)vcvarsall.bat

Or without Visual Studio macros use VS110COMNTOOLS

call $(VS110COMNTOOLS)..\..\VC\vcvarsall.bat
查看更多
登录 后发表回答