PATHEXT is expected to contain a list of extensions (including a leading period .), separated by semicolons. For example, to replicate the default extension list used by TCC:

 

set pathext=.exe;.btm;.bat;.cmd;.vbs;.js;.ws;.rex;.rexx;.pl;.rb;.py;.tcl

 

If you use a command in a batch file or at the command prompt and all of the following are true:

 

the PathExt configuration option is set

the command is not an alias

the command is not an internal command

the command is not a filename with an explicit extension (thus neither an executable extension nor a Windows file association is available)

 

then TCC will search the current directory and then each directory listed in PATH in turn for a file with its name matching the command and its extension matching one of the extensions in PATHEXT. The current directory is searched first, then the first directory in PATH is searched first, then the second, looking in each for each of the extensions in PATHEXT in the order listed.

 

Caution:  If you set the PathExt configuration option, and fail to set the PATHEXT variable, path searches without an explicit extension will fail as there will be no extensions for which to search! If you set the PathExt configuration option but do not create or modify the PATHEXT variable, TCC will use the one defined by Windows (if any), which will probably not include the .BTM, .REX, .REXX, .PL, .RB, .PY, or .TCL extensions.