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.

  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.

  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.

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.

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

    set <environment variable>=<value>
    

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

    Ee479070.note(en-US,WinEmbedded.60).gifNote:
    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.

  • 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.

Community Additions

ADD
Show: