我想在INCLUDE环境变量中附加一个值。这应该很容易。
例如输入
set PATH = "C:/new_entry;%PATH%
有效,可以通过
进行验证echo%PATH%
但是对INCLUDE做同样的事情并没有改变任何东西!
此外,INCLUDE未在“系统属性”>中列为环境变量。高级>环境变量,因此Visual Studio命令提示符正在从其他位置获取它。
我查看了C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ varsvall.bat,但它没有帮助
@echo off
if "%1" == "" goto x86
if not "%2" == "" goto usage
if /i %1 == x86 goto x86
if /i %1 == amd64 goto amd64
if /i %1 == x64 goto amd64
if /i %1 == arm goto arm
if /i %1 == x86_arm goto x86_arm
if /i %1 == x86_amd64 goto x86_amd64
if /i %1 == amd64_x86 goto amd64_x86
if /i %1 == amd64_arm goto amd64_arm
goto usage
:x86
if not exist "%~dp0bin\vcvars32.bat" goto missing
call "%~dp0bin\vcvars32.bat"
goto :SetVisualStudioVersion
:amd64
if not exist "%~dp0bin\amd64\vcvars64.bat" goto missing
call "%~dp0bin\amd64\vcvars64.bat"
goto :SetVisualStudioVersion
:arm
if not exist "%~dp0bin\arm\vcvarsarm.bat" goto missing
call "%~dp0bin\arm\vcvarsarm.bat"
goto :SetVisualStudioVersion
:x86_amd64
if not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing
call "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat"
goto :SetVisualStudioVersion
:x86_arm
if not exist "%~dp0bin\x86_arm\vcvarsx86_arm.bat" goto missing
call "%~dp0bin\x86_arm\vcvarsx86_arm.bat"
goto :SetVisualStudioVersion
:amd64_x86
if not exist "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat" goto missing
call "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat"
goto :SetVisualStudioVersion
:amd64_arm
if not exist "%~dp0bin\amd64_arm\vcvarsamd64_arm.bat" goto missing
call "%~dp0bin\amd64_arm\vcvarsamd64_arm.bat"
goto :SetVisualStudioVersion
:SetVisualStudioVersion
set VisualStudioVersion=12.0
goto :eof
:usage
echo Error in script usage. The correct usage is:
echo %0 [option]
echo where [option] is: x86 ^| amd64 ^| arm ^| x86_amd64 ^| x86_arm ^| amd64_x86 ^| amd64_arm
echo:
echo For example:
echo %0 x86_amd64
goto :eof
:missing
echo The specified configuration type is missing. The tools for the
echo configuration might not be installed.
goto :eof
答案 0 :(得分:0)
但对于旧版本:INCLUDE变量可以在机器环境变量中定义,但不是必需的。如果它不存在,那么您可以创建它并根据需要定义值。
另请注意,在vcvarsall.bat脚本中调用的子vcvar * .bat文件中定义/修改了INCLUDE。