다음을 통해 공유


Setting or Clearing an Environment Variable (Visual Studio) (Windows Embedded CE 6.0)

1/5/2010

After you create an OS design or open an existing OS design in the Platform Builder IDE, you can use the IDE to set or clear an environment variable for the OS design. For information about values that you can set, see Environment Variables.

The following procedures show how to set or clear an environment variable in the IDE.

Setting or clearing an environment variable in the IDE

To set an environment variable in the IDE

  1. From the Project menu, choose Properties.

  2. In the left pane, select Configuration Properties, and then select Environment.

  3. Choose New.

  4. In the Variable name box, type the name of the environment variable.

    You can use spaces in an environment variable name, but doing so can cause confusion because spaces are considered significant characters.

    For example, Platform Builder considers an environment variable with two consecutive spaces in its name to be a different environment variable than an environment variable with the same name and one space in its name.

  5. In the Variable value box, type a value.

    You can use spaces in the value of an environment variable because the value is treated as a string. A leading or trailing space in a value can cause confusion.

  6. To add the environment variable to the Environment variables list, choose OK.

  7. To save your changes and close the dialog, choose OK.

To clear an environment variable in the IDE

  1. From the Project menu, choose Properties.

  2. In the left pane, select Configuration Properties, and then select Environment.

  3. Select the environment variable you want to clear and then choose Remove.

  4. Save your changes by choosing OK.

Setting or clearing an environment variable from the command-line

When you build or rebuild a run-time image, during the build process the build system removes environment variables you cleared. For information about values that you can set, see Environment Variables.

The following procedures show how to set or clear an environment variable from a command prompt build window or a batch file.

To set an environment variable

  • In a command prompt build window or a batch file, type the following command:

    set <environment variable>=<value>
    

To clear an environment variable

  • In a command prompt build window or a batch file, type the following command:

    Note

    Ensure that you do not enter a character or space after the equal sign.

    set <environment variable>=
    

For information about determining the value of an environment variable, see Determining the Value of an Environment Variable.

To determine the value of an existing environment variable

  • At the command prompt, enter the following command.

    set <environment variable>
    

    The value for the environment variable is displayed. However, if you use only the first few characters in a variable name when entering the set command, this results in the display of values for all environment variables using that prefix.

See Also

Concepts

Environment Variables
IMG Environment Variables
BSP Environment Variables
Miscellaneous Environment Variables

Other Resources

How to Add a CEPC to an Ethernet Network
How to Configure and Build a Run-Time Image for a CEPC
How to Decrease Run-Time Image Size on a CEPC
How to Use the IDE to Create, Customize, and Build a Run-Time Image
How to Profile and Optimize a Display Driver
Configuring Multiple Ethernet Cards for a CEPC