NX Open Programmer's Guide > Executing NX Open Automation > Environment Variables
Environment Variables
Many execution methods require NX to automatically find and load application files (executables, menu files, dialog files). NX uses environment variables to locate a root directory for your application:
| Environment Variable (default) | Value |
|---|---|
UGII_CUSTOM_DIRECTORY_FILE = <NX install directory>\UGII\MENUS\custom_dirs.dat |
Full path to a file containing a list of root directories for all custom applications |
UGII_USER_DIR = none (undefined by default) |
Full path to a single application's root directory |
For released applications, UGII_CUSTOM_DIRECTORY_FILE is highly recommended — it supports root directories for multiple applications and is easy to copy across releases. UGII_USER_DIR is more useful during development of a single application. NX searches root directories from both the custom directory file and UGII_USER_DIR.
These variables are set when NX starts, defined in <NX install directory>\UGII\ugii_env.dat.
Note: The installation also contains UGII_UG_CUSTOM_DIRECTORY_FILE and ug_custom_dirs.dat, which are for applications released with NX itself — do not modify this variable or file.
Note: When specifying directory paths for these environment variables, a literal dollar sign ($) must be escaped as $$ to be accepted as part of the path, e.g.:
UGII_SITE_DIR=\\mysite\prod$$\myprod\nx
Related Topics
- Execution Overview
- Execution Modes
- Application Directory Structure
- How to Execute the Open API
- Unload Options
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/genid_environment_variables_36_1466 · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)