尚未为VS2008设置环境变量. [英] Environment variables is not being set for VS2008....

查看:55
本文介绍了尚未为VS2008设置环境变量.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想通过以管理员身份在VS2008安装文件夹中运行"vcvars32.bat"来设置VS2008的环境变量.但是"vcvars32.bat"不起作用,也没有设置环境.变量.我尝试手动添加它,但是"vcvars32.bat"文件的内容非常困难.

Hi ,
I want to set environment variables for VS2008 by running "vcvars32.bat" as administrator in the VS2008 installation folder. But "vcvars32.bat"is not working and not setting env. variables. i tried to add it manually but the content of "vcvars32.bat" file is pretty difficult.

推荐答案

如果从开始"菜单开始,则找到Visual Studio 2008并深入到Visual Studio 2008工具,您将找到一个Visual Studio命令提示符(2008).

这将启动命令窗口并同时设置环境.只要将其保持打开状态,就可以使用变量.

希望对您有所帮助.
If you start from the Start Menu, then find Visual Studio 2008 and drill down to the Visual Studio 2008 Tools, you''ll find a Visual Studio Command Prompt (2008).

That starts a command window and sets the environment at the same time. As long as you leave it open, you''ll have the variables.

Hope that helps.


每个进程都有自己的环境.如果更改环境,则只有进行更改的子进程才能看到新变量或修改后的变量.在进程中设置的任何环境变量只会持续到该进程终止为止.

因此,如果双击VCVARS32.BAT,则会发生以下情况:

-Windows看到您正在启动批处理文件,它将执行cmd/c"VCVARS32.BAT"
-Windows加载器会创建EXPLORER.EXE环境的副本,并将其附加到CMD.EXE的进程中.
-CMD.EXE启动并运行批处理文件,为其进程设置环境变量,更改其环境副本
-CMD.EXE终止,并且随之复制环境.

因此,如果要更改特定用户的根环境,最好的选择是转到控制面板并在其中进行操作,或者让VC ++安装程序进行更改.

干杯,



PS:如果您向我们提供一些为什么要这样做的详细信息,那么有人可能会有更好的建议
Each process has it''s own environment. If you change the environment then ONLY child processes of the one doing the changing sees the new or modified variable. Any environment variables set in a process only last until that process terminates.

So if you double click on VCVARS32.BAT the following happens:

- Windows sees you''re launching a batch file, it executes cmd /c "VCVARS32.BAT"
- The Windows loader creates a copy of EXPLORER.EXE''s environment and attaches it to CMD.EXE''s process.
- CMD.EXE starts and runs the batch file, setting the environment variables for its process, changing its copy of the environment
- CMD.EXE terminates and along with it goes the copy of the environment.

So if you want to change the root environment for a particular user your best bet is to go to control panel and do it there or let the VC++ installer make the changes.

Cheers,

Ash

PS: If you give us some details of WHY you want to do this then someone might have a better suggestion


这篇关于尚未为VS2008设置环境变量.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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