Home | Previous Page | Next Page   Environment Variables > Using Environment Variables on Windows >

Environment Settings for Command-Prompt Utilities

You can set environment variables for command-prompt utilities in the following ways:

Using the System Applet to Work with Environment Variables

The System applet provides a graphical interface to create, modify, and delete system-wide and user-specific variables. Environment variables that are set with the System applet are visible to all command-prompt sessions.

To change environment variables with the System applet in the control panel
  1. Double-click the System applet icon from the Control Panel window.

    Click the Environment tab near the top of the window. Two list boxes display System Environment Variables and User Environment Variables. System Environment Variables apply to an entire system, and User Environment Variables apply only to the sessions of the individual user.

  2. To change the value of an existing variable, select that variable.

    The name of the variable and its current value appear in the boxes at the bottom of the window.

  3. Highlight the existing value and type the new value.
  4. To add a new variable, highlight an existing variable and type the new variable name in the box at the bottom of the window.
  5. Next, enter the value for the new variable at the bottom of the window and click the Set button.
  6. To delete a variable, select the variable and click the Delete button.
Important:
In order to use the System applet to change System environment variables, you must belong to the Administrators group. For information on assigning users to groups, see your operating-system documentation.

Using the Command Prompt to Work with Environment Variables

The following diagram shows the syntax for setting an environment variable at a command prompt in Windows.

Read syntax diagramSkip visual syntax diagram>>-set--ABCD--=--value-----------------------------------------><
 

If no value is specified, the environment variable is unset, as if it did not exist.

For more information on how to read syntax diagrams, see Syntax Diagrams of the introduction.

To view your current settings after one or more IBM Informix products are installed, enter the following command at the command prompt.

Read syntax diagramSkip visual syntax diagram>>-set---------------------------------------------------------><
 

Sometimes you must add information to an environment variable that is already set. For example, the PATH environment variable is always set in Windows environments. When you use an IBM Informix product, you must add the name of the directory where the executable files for the IBM Informix products are stored to the PATH.

In the following example, INFORMIXDIR is d:\informix (that is, during installation, IBM Informix products were installed in the d: \informix directory). The executable files are in the bin subdirectory, d:\informix\bin. To add this directory at the beginning of the PATH environment-variable value, use the following command:

set PATH=d:\informix\bin;%PATH%

Rather than entering an explicit pathname, you can use the value of the INFORMIXDIR environment variable (represented as %INFORMIXDIR%), as the following example shows:

set INFORMIXDIR=d:\informix
set PATH=%INFORMIXDIR%\bin;%PATH%

You might prefer to use this version to ensure that your PATH entry does not contradict the search path that was set in INFORMIXDIR and to avoid the need to reset PATH whenever you change INFORMIXDIR.

For more information about setting and modifying environment variables, refer to your operating-system manuals.

Using dbservername.cmd to Initialize a Command-Prompt Environment

Each time that you open a Windows command prompt, it acts as an independent environment. Therefore, environment variables that you set within it are valid only for that particular command-prompt instance.

For example, if you open one command window and set the variable, INFORMIXDIR, and then open another command window and type set to check your environment, you will find that INFORMIXDIR is not set in the new command-prompt session.

The database server installation program creates a batch file that you can use to configure command-prompt utilities, ensuring that your command-prompt environment is initialized correctly each time that you run a command-prompt session. The batch file, dbservername.cmd, is located in %INFORMIXDIR%, and is a plain text file that you can modify with any text editor. If you have more than one database server installed in %INFORMIXDIR%, there will be more than one batch file with the .cmd extension, each bearing the name of the database server with which it is associated.

To run dbservername.cmd from a command prompt, type dbservername or configure a command prompt so that it runs dbservername.cmd automatically at start up.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]