从Visual Studio 2013命令提示符附加到INCLUDE环境变量 [英] Append to INCLUDE environment variable from Visual Studio 2013 Command Prompt

查看:494
本文介绍了从Visual Studio 2013命令提示符附加到INCLUDE环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要向我的INCLUDE环境变量追加一个值。

I want to append a value to my INCLUDE environment variable. This should be easy.

例如键入

set PATH = "C:/new_entry;%PATH%

可以通过


echo%PATH%

echo %PATH%

但对INCLUDE

此外,INCLUDE在系统属性>高级>环境变量中未列为环境变量,因此Visual Studio命令提示符从某处

Furthermore, INCLUDE is not listed as an environment variable in System Properties > Advanced > Environment Variables, so Visual Studio command prompt is picking it up from somewhere else.

我查看了C:\Program文件(x86)\Microsoft Visual Studio 12.0 \VC\varsvall.bat,但是没有帮助

I looked at C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\varsvall.bat, but it is not helpful

@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


推荐答案

2013



但对于旧版本:INCLUDE变量可以在机器环境变量中定义,但不是必需的。如果不存在,则可以创建它,并根据需要定义该值。

Not Tested with VS 2013

But for older versions: The INCLUDE variable can be defined in machine Environment Variables, but is not required. If it does not exist, then you can create it and define the value as you wish.

另请注意,INCLUDE是在vcvarsall中调用的子vcvar * .bat文件中定义/修改的。 bat脚本。

Also note that INCLUDE is defined/modified in the sub vcvar*.bat files called within the vcvarsall.bat script.

这篇关于从Visual Studio 2013命令提示符附加到INCLUDE环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆