Skip to main content

Problem:

Some environment variables may have been set for some reasons from Windows registry or set as system and user variables. How can you override them?

Resolution:

You can override the values of existing environment variables by setting them with new values. If you are using the Net Express command prompt to compile, you will first need to set new values for these environment variables to override the default values. If for example, you have set COBCPY to point to x:\\copybook from the Windows registry. This would be appended along the other directories that Net Express will set. Net Express usually sets COBCOPY with the following directories:

"C:\\Program Files\\Micro Focus\\Net Express 4.0\\DialogSystem\\SOURCE";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\GUICL";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\BASECL";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\OLECL";

The above directories will vary according to the directory where Net Express is installed. By default then, you would end up with the following values:

"C:\\Program Files\\Micro Focus\\Net Express 4.0\\DialogSystem\\SOURCE";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\GUICL";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\BASECL";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\OLECL";x:\\copybook

To override the above with a different directory (e.g. d:\\mycopy), you will need to run the following SET command:

SET COBCPY="C:\\Program Files\\Micro Focus\\Net Express 4.0\\DialogSystem\\SOURCE";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\GUICL";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\BASECL";"C:\\Program Files\\Micro Focus\\Net Express 4.0\\Base\\SOURCE\\OLECL";d:\\mycopy

To find out what the values for environment variables, you can simply echo the environment variable from the Net Express Command Prompt (e.g. echo %cobcpy%)

To override these environment variables from a project, go to the Project Properties (click on Project > Properties from the menu) and click on the IDE button. You will be able to specify there environment variables and their values.

Old KB# 3826