### 16.7.2. Using a Customized Export Program from the Command Line

You may run your program directly from the command line started from the ANSYS CFX Launcher (Tools > Command Line). Such a command line will have the environment variables and path set appropriately.

Important: It is important to run the command line in the CFX environment. For details, see Command Line in the CFX Reference Guide.

#### 16.7.2.1. Running a Customized Export Program Directly from the Command Line

For the purposes of describing what you can do, assume that the executable file is called `myexport` and is contained in the directory /home/smith/export/ (UNIX) or c:\smith\export (Windows). You want to specify the results file called file.res in the same directory and make the basename `example`.

##### 16.7.2.1.1. UNIX

To run the program directly on a UNIX system, open a command line started from the ANSYS CFX Launcher (Tools > Command Line) and call your program using:

    ./myexport file.res example

assuming that the current directory is /home/smith/export/.

##### 16.7.2.1.2. Windows

On a Windows machine, run the program by opening a command line started from the ANSYS CFX Launcher (Tools > Command Line), changing directory to c:\smith\export, and typing:

    myexport file.res example

Note: Just double-clicking on the name of the program in the Windows Explorer, or using the Execute `myexport.exe` option in Microsoft Developer Studio does not readily give you the option to enter command-line arguments.

#### 16.7.2.2. Running a Customized Export Program using cfx5export from the Command Line

Your executable can be run directly from the command line by using the cfx5export command. This enables you to issue an export command without specifying the location of the executable each time; an environment variable remembers the location of the custom export executable.

For the purposes of describing the procedure, assume the executable file is called myexport and is contained in the directory `/home/smith/export/` (UNIX) or `c:\smith\export` (Windows). Specify the results file called `file.res` in the same directory and make the basename example.

To run the program using the `cfx5export -custom` command, add the following line to the `.cfx5rc` file:

    CFX_EXPORT_EXEC="<executable_path>"

where `<executable_path>` is the full path and name of the executable (for example, `/home/smith/export/myexport` or `c:\smith\export\myexport` as appropriate). For details, see Resources Set in cfx5rc Files in the CFX Introduction.

The cfx5export command can be used with the custom argument for the given example. Type:

    cfx5export -custom file.res example

into a UNIX terminal or a suitable Windows command prompt and press Return or Enter. For details, see Command Line in the CFX Reference Guide.

Release 18.2 - © ANSYS, Inc. All rights reserved.