# Running FlashBASIC from a Windows command prompt

BASIC object code can be exported to a DOS file with a .D3F extension, and then combined
 with a launcher to turn it into an executable that can be run directly from a Windows command
 prompt. It is also possible to configure Windows to recognize the .D3F extension as an executable
 and associate it with the Flash interpreter (see Notes below), which makes the Flash module
 significantly smaller.

**For UNIX:**Not Supported

 BASIC modules can be run from a Windows command prompt and from any machine in a D3 domain. It
 does not require that a VME or FSI service is running on the same machine. Only one user license
 is consumed per workstation, even if multiple BASIC modules are run from a Windows command
 prompt.

 If the module does not need to use the VME service (no execute,
 oconv, and so on), then the module is not automatically logged into the VME
 service. If the module does need access to the VME, it is automatically logged in to the VME
 service using a user-ID identical to the Windows user name, but appended with an underscore. The
 VME account that the user is logged in to is specified by the -d switch.

- Compile and export the module (the (f option uses the floating point chip for faster execution): ```
compile bp mymodule (ofg
```

- Do one of the following: Run the module: ```
d3flash –f mymodule
```

- Make an EXE and run the EXE: ```
d3flash –e –f mymodule
mymodule
``` Note: When the module expects arguments, the tclread statement can retrieve them. If the module was turned into an EXE, the whole line is returned as expected. If the module is run from d3flash -f mymodule, specify the arguments with the -a switch.

- When the module does any terminal input or output, the display is sent to the Windows command prompt console. The -t switch allows using a Telnet client as a display device.

- If the Flash module calls an external subroutine, be sure to use an explicit path or add the subroutine to the Domain Catalog.

 Tip:
 To instruct Windows to recognize the .D3F file as an executable:

- Add the D3F extension to the pathtext variable: ```
set pathtext=%pathtext%;.d3f
```

- Run the assoc command to associate the D3F extension to D3FLASH: ```
assoc .d3f=d3flash
```

- Run the ftype command to specify how to run it: ```
ftype D3Flash=d3flash.exe -f %1 -a "%*"
``` The D3Programs directory must be in the path, or use an explicit path in the ftype command.

---
Source: https://d3codex.com/pickbasic-flashbasic/running-flashbasic-from-a-windows-command-prompt/ - part of the D3Codex reference.
