---
rexxpub:
  defaults: rony.yaml
  logo: oorexx
---

<!-- 142_AutoWin_assoc_V01.odp (2026-10-15 09:40) -->

<!-- slide # 1 (2026-10-15 09:40) ----------------------------- ODP slide # 1 -->
. slide cover
# Windows-Automatisation 4

. subtitle
**Windows: Setting Filetype Associations**

. cover-art
. picture img/142_AutoWin_assoc_V01/p01-diagram-7.png

<!-- slide # 2 (2026-10-15 09:40) ----------------------------- ODP slide # 2 -->
# Configuration of File Types and Associated Applications

. after
- Installation programs, 1
    . after
    - Associate file types with identifiers
        - CLI command "`assoc`"

          . with
          ```rexx
          assoc /?
          ```

            - Explains the command

              . click
              ```rexx
              assoc
              ```

            . with
            - Lists all currently defined associations

              . click
              ```rexx
              assoc | more
              ```

            . with
            - Lists all currently defined associations, stops output if CLI window is full

              . click
              ```rexx
              assoc .rex
              ```

            . with
            - Lists the association of the given file type

              . click
              ```rexx
              assoc .recks=rexxfile
              ```

            . with
            - Defines a new association: files with the file type "**.recks**" get associated with the identifier "**rexxfile**"

<!-- slide # 3 (2026-10-15 09:40) ----------------------------- ODP slide # 3 -->
# Configuration of File Types and Associated Applications

. after
- Installation programs, 2
    . after
    - Define default programs to execute associated file types
        - CLI command "**ftype**"

          . with
          ```rexx
          ftype /?
          ```

            - Explains the command

              . click
              ```rexx
              ftype
              ```

            . with
            - List all currently defined default programs to execute associated file types

              . click
              ```rexx
              ftype | more
              ```

            . with
            - List all currently defined default programs to execute associated file types , stops output if CLI window is full

              . click
              ```rexx
              ftype rexxfile
              ```

            . with
            - Lists the defined default program with all pre-set arguments for the given associated file type

              . click
              ```
              ftype rexxfile=D:\Programme\ooRexx\rexx.exe "%1" %*
              ```

            . with
            - Defines the default program ("**rexx.exe**") which executes the associated file type (associate file type with the identifier "**rexxfile**") and defines the pre-set arguments for starting the program

<!-- slide # 4 (2026-10-15 09:40) ----------------------------- ODP slide # 4 -->
# Configuration of File Types and Associated Applications

. after
- Loading/executing of files with their default programs
    . after
    - Windows Explorer
        - Double-click with the mouse on the file
        - Select the file and press the "enter" key on the keyboard
        - Click right mouse button and select "Open"
    . after
    - CLI
        - Enter the file name with its file type and press the "enter" key

<!-- slide # 5 (2026-10-15 09:40) ----------------------------- ODP slide # 5 -->
# Configuration of File Types and Associated Applications

. after
- Loading/executing of files with their default programs
    . after
    - CLI (continued)
        - File type may be omitted, if the environment variable "**PATHEXT**" is defined
            - List the actual values of the environment variable in the CLI window
        . click
        - `echo %pathext%`
            - Output (maybe) :

              . with
              ```rexx
              .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.REX
              ```

        . click
        - Adding a new value to the environment variable "PATHEXT"

          . with
          ```bash
          set PATHEXT=%pathext%;.RECKS
          ```

        . click
        - Define it for all Windows sessions
            - Select "**Properties → Extended → Environment Variables**" of the context menu for the object "**My Computer**"
            - Pick "**System Variables**" in the lower part of the window and locate the entry "**PATHEXT**", add the file type and save the changes

<!-- slide # 6 (2026-10-15 09:40) ----------------------------- ODP slide # 6 -->
# Configuration of File Types and Associated Applications

. after steps
- Concluding example
    . after
    - Define a proper file type for ooRexx programs

      . with
      ```
      assoc .recks=recksFiles
      ftype recksFiles=D:\Programme\ooRexx\rexx.exe "%1" %*
      set   pathext=%pathext%;.RECKS
      ```

- From now on all files with the file type ".recks" will be executed by ooRexx (= default program for "**recksFiles**"), e.g. entering the following in a CLI:

  . with
  ```rexx
  mySuperDuper_ooRexxProgram.recks
  ```

- In this case it is not necessary to supply the file type for ".recks" files, e.g. entering the following in a CLI:

  . with
  ```rexx
  mySuperDuper_ooRexxProgram
  ```

<!-- slide # 7 (2026-10-15 09:40) ------------ business card (not in the ODP) -->
. slide card logo=none
# Contact