Microsoft KB Archive/311933

= How to specify Environment variables in project settings by using Visual C++ .NET or Visual C++ 2005 =

Article ID: 311933

Article Last Modified on 1/17/2006

-

APPLIES TO


 * Microsoft Visual C++ 2005 Express Edition
 * Microsoft Visual C++ .NET 2003 Standard Edition
 * Microsoft Visual C++ .NET 2002 Standard Edition

-



This article was previously published under Q311933



IN THIS TASK
SUMMARY
 * Specify File Paths in Visual C++
 * How to Use Environment Variables
 * How to Set Environment Variables in Microsoft Windows Server 2003, in Windows 2000, and in Windows XP



SUMMARY
This step-by-step article describes how to use Environment variables in Visual C++ .NET or Visual C++ 2005.

back to the top

Specify File Paths in Visual C++
There are two methods that you can use to specify file paths in Visual C++:
 * Use built-in predefined macros that are included in Visual C++.
 * Use Environment variables.

An Environment variable can be a system variable or a user variable with an associated value. You can use Environment variables to set project properties such as the input file path or the output file path.

back to the top

How to Use Environment Variables
You can use an Environment variable in the same way that you use built-in Visual Studio .NET macros. For example, to use an Environment variable named MyEnvVar, type $(MyEnvVar) in the appropriate Properties field for your project.

back to the top

How to Set Environment Variables in Microsoft Windows Server 2003, in Windows 2000, and in Windows XP
To set Environment variables in Windows Server 2003, in Windows 2000, or in Windows XP, follow these steps:
 * 1) Click Start, point to Settings, and then click Control Panel.
 * 2) Double-click System.
 * 3) On the Advanced tab, click Environment Variables.
 * 4) Under User or System variables, click New.

Note In Windows Server 2003, click New under User variables for .
 * 1) In the Variable Name text box, type the name of the Environment variable that you want to add.
 * 2) In the Variable Value text box, type the value of this new variable.
 * 3) Click OK to save the new variable.

back to the top

Keywords: kbhowtomaster KB311933

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.